Python ProgrammingPython Programming

How to iterate over list in python?

You can iterate list items by using a for loop.

Print all items of a list:

testList = ["Canada", "Japan", "London", "Germany", "Africa"]
 
for item in testList:
    print(item)
Output
Canada
Japan
London
Germany
Africa