+ 1

a = [i for i in range(8)] print(a) for i in a: a.remove(i) print(i) print (sum(a))

Here the second for print only even number why is that .

17th Jun 2019, 7:28 AM
Praveen E
Praveen E - avatar
3 odpowiedzi
+ 1
~ swim ~ I know the answer its 16 I printed after every remove it shows only odd no. But I don't know why?
17th Jun 2019, 8:11 AM
Praveen E
Praveen E - avatar