Python Introducing Lists Using Lists Continental

Kaisma Penn-Titley
Kaisma Penn-Titley
4,434 Points

Python: Introducing Lists Challenge. Print only countries that begin with Lette "A".

Don't understand what I'm missing.

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

1 Answer

Dario Bahena
Dario Bahena
10,687 Points

You are missing the bullet points in the strings.

continents = [
    'Asia',
    'South America',
    'North America',
    'Africa',
    'Europe',
    'Antarctica',
    'Australia',
]

for continent in continents:
    if continent[0] == "A":
        # add a "* " (including the space)  to continent then print it out.
        print( "* " + continent)