Home > front end >  I need to break a for loop in python with specific condition but i am not sure what condition I shou
I need to break a for loop in python with specific condition but i am not sure what condition I shou

Time:11-23

here is my dummy data enter image description here

CodePudding user response:

Easiest way will be adding enumerate

for index, j in enumerate(mylist2):
        mylist.append(j)
        if index >= generation:
             break
  • Related