逻辑运算符 | 解释 |
---|---|
与 | and |
或 | or |
非 | not |
and:
age = int(input())
if age>= 0 and age<18 :
print("本网吧不让你进,你去找找黑网吧吧。")
elif age<0:
print("您这阴寿不在地府待着跑我这网吧干什么")
else:
print("欢迎光临")
or
age = int(input())
if age>= 0 and age<18 :
print("本网吧不让你进,你去找找黑网吧吧。")
elif age<0 or age>=18:
print("欢迎光临")
not
one_human_is_a_male = True
if not one_human_is_a_male:
print("女性止步")
else:
print("男性wc欢迎您")