1 Star 0 Fork 0

北京大学-夏敏/Python_XDRupdate

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
if循环语句.txt 925 Bytes
一键复制 编辑 原始数据 按行查看 历史
XDR 提交于 2020-11-26 19:41 . if循环语句
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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/pkuecho/python_-xdr.git
git@gitee.com:pkuecho/python_-xdr.git
pkuecho
python_-xdr
Python_XDRupdate
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385