5. Control flow

2016-10-14  本文已影响0人  捕鲸小能手

Condition

if True:
    print(True)
elif False:
    print(False)
else:
    print(None)

For loop

for fruit in ['apple', 'banana']:
    print(fruit)

for i in range(10):
    print(i)  # 0 ... 9

While loop

while True:
    print('infinite loop')
    continue
    break
上一篇下一篇

猜你喜欢

热点阅读