“For” loop first iteration

前端 未结 13 2343
渐次进展
渐次进展 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:58

    Can't you do root.copy(something.get()) before the loop?

    EDIT: Sorry, I missed the second bit. But you get the general idea. Otherwise, enumerate and check for 0?

    EDIT2: Ok, got rid of the silly second idea.

    0 讨论(0)
提交回复
热议问题