if 语句
if ...: passelif ...: passelse: pass
for 循环
for i in range(10): print(i)
while 循环
while True: if ...: pass else: break
break、continue
break,跳出整个循环
continue,跳出当次循环继续下次循环
三元运算
a=1b=2c=3d = a if a > b else c
来源: