循环 Loops
condition = 0
while condition < 10:
condition = condition + 1
print("the condition is true")
items = [1, 2, 3, 4]
for item in items:
print(item)
for index, item in enumerate(items):
print(index, item)
for item in range(15):
print(item)
Break and continue
items = [1, 2, 3, 4]
for item in items:
if iem == 2:
break
print(item)
items = [1, 2, 3, 4]
for item in items:
if iem == 2:
continue
print(item)