python - How to jump out of for loop, seems to be dizzy
伊谢尔伦
伊谢尔伦 2017-06-22 11:52:06
0
1
803
h = ['hp','op']


for x in ['POP','PHP','PYTHON']:
    for y in h:
        if y in x:
            continue #如果这个跳出循环 ,下一句就不会print
    print x 

My understanding is to jump directly out of the outermost for loop, but why is it not like this?

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(1)
我想大声告诉你

continue only jump out of the nearest (or innermost) loop , that is, the inner for.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template