猿问

continue在while与for嵌套中不起作用

a = 5
while a<=10:
               a =a + 1               
               for i in range(1,7):                              
                   print i                              
                   if i == 2:
                           continue               
                    if a == 7:                              
                           break

continue不起左右,不跳过去2


慕容708150
浏览 214回答 1
1回答

繁花不似锦

跳过了,continue后面没任何语句 没意义
随时随地看视频慕课网APP
我要回答