作者:大男孩小男淫 | 来源:互联网 | 2023-10-12 16:28
snippet 程序片段
条件:
if condition:pass
else:pass
if condition:
elif:
循环
强制终止:ctrl+C
while condition:pass
else:pass
for target_list in expression_list:pass
for x in range(0,10,2):pass
a=[['apple','orange','banana','grape'],(1,2,3)]
for x in a:for y in x:print(y,end=' ')
else:print('fruit is gone')
break跳出最内部的整个循环,continue结束最内部的本次循环