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

jike_2532890 Python 控制流 最后由 qq_yvqag5pr 于07月27日回复

  • 2 回答
  • 432 浏览

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