Python第二课---条件判断和循环
2019-01-15 本文已影响0人
计算机视觉__掉队选手
if 语句
1.语法
if True:
print("hello world")
if True:
print("hello world")
else:
print("I hate the world")
if 2>1:
print("1")
elif 2<3"
print("2")
else:
print("finish")
循环语句
while 循环
语法
while True:
print("hello world")
for 循环
语法
for i in range(3):
print(i)
0
1
2