python continue 和 break的区别

for letter in "Python":
    if letter == "h":
        continue
    print(letter)

结果;

P
y
t
o
n

for letter in "Python":
    if letter == "h":
        break
    print(letter)

结果:

P
y
t
 

猜你喜欢

转载自www.cnblogs.com/fendoudemangguoailiulian/p/9258470.html
今日推荐