3 ms·
I would have liked to have seen mention of this while loop instead of the index-based one. while my_list: v = my_list.pop(0) print v Altho
by ff0066mote 14y ago
I would have liked to have seen mention of this while loop instead of the index-based one.
while my_list:
v = my_list.pop(0)
print v
Although it doesn't fit the theme of the others because it consumes the list, it is certainly a more natural use of "while" to loop over a list.