标签:pac reason hub erro mamicode aaa ocs strong dea
a = 9
b = 2
#乘
result = a * b
print(‘{}*{}={}‘.format(a, b, result))
#除
result = a / b
print(‘{}/{}={}‘.format(a, b, result))
#幂
result = a ** b
print(‘{}**{}={}‘.format(a, b, result))
#整除
result = a // b
print(‘{}//{}={}‘.format(a, b, result))
#取模
result = a % b
print(‘{}%{}={}‘.format(a, b, result))
n1 = int(input(‘请输入第一个数‘))
n2 = int(input(‘请输入第二个数‘))
result = n1 > n2
print(‘%d > %d is %s‘ %(n1, n2, result))
result = n1 < n2
print(‘%d < %d is %s‘ %(n1, n2, result))
result = n1 == n2
print(‘%d == %d is %s‘ %(n1, n2, result))
result = n1 != n2
print(‘%d != %d is %s‘ %(n1, n2, result))
UserName_Check = ‘xiaoming‘
UserName = input(‘请输入姓名:‘) #输入错误用户名
result = UserName_Check == UserName
print(‘输入匹配是:%s‘ %(result))
UserName = input(‘请重新输入姓名:‘) #输入正确用户名
result = UserName_Check == UserName
print(‘输入匹配是:%s‘ %(result))
Num1 = 100
Num2 = 100
print(id(Num1), Num1)
print(id(Num2), Num2)
print(Num1 is Num2)
and 逻辑与
or 逻辑或
not 逻辑非
Num1 = 10000
Num2 = 10000
print(‘Num1:‘, Num1, id(Num1))
print(‘Num2:‘, Num2, id(Num2))
print(‘Num1 is Num2: ‘, (Num1 is Num2))
标签:pac reason hub erro mamicode aaa ocs strong dea
原文地址:https://www.cnblogs.com/King-Penguin/p/12079658.html