用break语句直接跳出循环结构
for months in "hello":
if months == "l":
break
print(months)
h
e
o
**# 用 continue语句将结束本轮循环,进入下一个循环**
for months in "hello":
if months == "l":
continue
print(months)
h
e
**# 该语句会循环10次,但没什么变化,空操作**
for x in range(10):
pass