num = int(input("请输入你的数字:"))
if(num < 3):
print(num + 2)
elif(num >4 and num < 6):
print("好吧")
else:
print("还好")
结果:
主要就是逻辑运算符跟C++/C#之类的不太一样
and 与
or 或
not 非
标签:语句,elif,Python,Demo,运算符,num,print From: https://blog.51cto.com/u_15906863/5977827