代码拉取完成,页面将自动刷新
if语句:
a = 66
b = 200
if b > a:
print("b is greater than a")
Elif:
a = 66
b = 66
if b > a:
print("b is greater than a")
elif a == b:
print("a and b are equal")
Else:
a = 200
b = 66
if b > a:
print("b is greater than a")
elif a == b:
print("a and b are equal")
else:
print("a is greater than b")
a = 200
b = 66
if b > a:
print("b is greater than a")
else:
print("b is not greater than a")
if else :
a = 200
b = 66
print("A") if a > b else print("B")
a = 200
b = 66
print("A") if a > b else print("=") if a == b else print("B")
And:
a = 200
b = 66
c = 500
if a > b and c > a:
print("Both conditions are True")
嵌套 If:
x = 52
if x > 10:
print("Above ten,")
if x > 20:
print("and also above 20!")
else:
print("but not above 20.")
pass:
a = 66
b = 200
if b > a:
pass
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。