Python Introducing Lists Using Lists Continental

Botshelo Tsogo Tiroyamodimo
Botshelo Tsogo Tiroyamodimo
3,055 Points

Error on my for loop for numbers that start with A

I cant get my code to work, it says my second line has an error

continents.py
continents = [
    'Asia',
    'South America',
    'North America',
    'Africa',
    'Europe',
    'Antarctica',
    'Australia',
]
for continent in continents:
    if continents[0] == 'A':
        print(continent)

1 Answer

Steven Parker
Steven Parker
182,590 Points

You need to check the first letter of the loop variable (the singular name) instead of the list (plural name).

Also, the names are supposed to be printed with a "bullet" (asterisk) in front.