This is probably one of the most commonly used skills in programming.

Back in lesson 10 - For Loops, I mentioned that loops make it easy to complete an instruction like messaging happy birthday to every user in an organisation with a simple loop. Look at the simple example below.

https://replit.com/@bitFez/Listshappybirthdayexample#main.py

The example above is overly simplified. We will soon go into more complex examples.

Notice that I set the range of the loop between 0 and 4? in lesson 6.5 String functions, I showed you the len() function that returned how many characters there are in a string. We can use the len function on a list too. however on a list it behaves differently. It returns how many items there are in a list/array.

names = ["Alexy", "Hans", "Melvin", "Hakan"]

for i in range(0, len(names):
	print(f"Happy birthday, {names[i]}!")

This is useful if we don’t know how many items there are in a list.

Tasks