Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Problem With This?

l = ["a", "b", "c", "d", "e"]
for x in range(0, len(l)):
    if(len(l)==0):
        break
    print(l[x])
    l.remove(l[x])

#the problem is the for loop after being emptied still executes once
 
PREVIOUS NEXT
Tagged: #Problem #With
ADD COMMENT
Topic
Name
4+4 =