Count iterations of a “for” loop in Python

前端 未结 0 1638
天命终不由人
天命终不由人 2021-01-13 12:48

I would like to know how many iterations of a for loop were executed. Is there an elegant way? I came up with this:

iterations_num = 0
for iterations_num, ele         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题