Chirag
Chirag

Reputation: 1

Why the output is not an empty list in python

list1=[1,2,3,4,5]
for i in list1:
    list1.remove(i)
print(list1)

why the output is [2,4] why not empty list as the value of I will be list elements

Upvotes: 0

Views: 35

Answers (0)

Related Questions