Skip to content

How to reverse a list in Python using for loop?

a = ['a', 'b', '4', '5', 'd'] #reverse the List
for i in reversed(a):
    print(i)
See also  How to get the ip address of laptop with Python?
, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.