6 lines
147 B
Python
6 lines
147 B
Python
|
|
l = [ 10, 20, 30, 40 ]
|
||
|
|
for i in l:
|
||
|
|
print(i)
|
||
|
|
for i in reversed(l): # reversed produces an iterator, so only O(1) memory is used
|
||
|
|
print(i)
|