立即学习:https://edu.csdn.net/course/play/24797/282158?utm_source=blogtoedu
比较运算符:
print('hello world!)
a = int(input("请输入a"))
b = int(input("请输入b"))
print(a>b)
is is not
逻辑运算符:
and or not
a = 30
b = 27
print(3**3 < a and 5**2 >b)
print(3**3 < a or 5**2 >b)
print(not 3 ** 3 < 27)
print(not (3**3 < a or 5**2 >b))
三目运算符
age = int (input("轻输入您的年龄:"))
print("年龄大于25") if age > 25 else(print("年龄等于25") if age = 25 else print("年龄小于25"))
s = print("年龄大于25"),“您是一个成年人” if age > 25 else print("小于等于25")
print s;
s = print("年龄大于25");“您是一个成年人” if age > 25 else print("小于等于25")
print s;
in 运算符,判断序列的包含关系