Iterate again within the for loop

前端 未结 7 1013
走了就别回头了
走了就别回头了 2021-01-21 07:50

is there a way to iterate again within the for loop? For example:

for x in list:
  if(condition):
      #I\'d like to grab the next iteration of the lis         


        
7条回答
  •  南方客
    南方客 (楼主)
    2021-01-21 08:42

    You want the continue statement.

    for x in list:
      if(condition):
          continue
    

提交回复
热议问题