how to loop down in python list (countdown) -



how to loop down in python list (countdown) -

how loop downwards in python list?

for example

loop:

l = [1,2,3] item in l print item #-->1,2,3

loop down:

l = [1,2,3] ??? print item #-->3,2,1

thank you

another solution:

for item in l[::-1]: print item

python loops

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -