Identify which iteration you are on in a loop in python

前端 未结 5 580
走了就别回头了
走了就别回头了 2020-12-11 15:33

Basically I would like to be able to tell when I\'m on the Nth item in a loop iteration. Any thoughts?

d = {1:2, 3:4, 5:6, 7:8, 9:0}

for x in d:
    if last         


        
5条回答
提交回复
热议问题