Instruction
Great! Before we move on to list usage in Python, let's do a quick recap of the basics. Lists are data structures typically used to store elements of the same type. List elements are ordered – i.e., each element is assigned a unique integer index.

The code below shows the ABCs of list handling:
- Define a list:
- Access the first element:
- Access the second and third elements:
- Add a new element:
- Delete by index:
- Delete by value:
- Iterate over the list:
- Check if the list contains an element:
countries = ['Spain', 'France', 'USA']
countries[0]
countries[1:3]
countries.append('Mexico')
del countries[2]
countries.remove('Spain')
for country in countries: print(country)
if 'Germany' in countries:
print('Ich spreche Deutsch!')
Exercise
Let's do a quick list exercise as a warm-up. You are given a list of countries. Do the following:
- Remove the UAE from the list.
- Add Japan to the list.
- For each country in the modified list, print the following sentence:
{country} contains {len(country)} letters!
Stuck? Here's a hint!
Use the following for loop:
for country in countries: print(country, 'contains', len(country), 'letters!')



