Python For Loop Exercises

Let’s check out some exercises that will help you understand Python’s For Loops better.

Exercise 8-a

Write a for loop so that every item in the list is printed.

You can start a for loop and write a print statement inside it.

for i in …:

for i in lst:

Exercise 8-b

Write a for loop which print "Hello!, " plus each name in the list. i.e.: "Hello!, Sam"

You can add strings together with “+” sign.: “Hello!, ” + “Sam” = “Hello!, Sam”

for i in lst:
print("Hello!, " + i)