“For” loop first iteration

前端 未结 13 2388
渐次进展
渐次进展 2020-12-04 15:17

I would like to inquire if there is an elegant pythonic way of executing some function on the first loop iteration. The only possibility I can think of is:

f         


        
13条回答
  •  醉话见心
    2020-12-04 15:40

    If something.get() iterates over something, you can do it also as follows:

    root.copy(something.get())
    
    for member in something.get():
      #  the rest of the loop
    

提交回复
热议问题