Python Introducing Lists Using Lists Continental

Botshelo Tsogo Tiroyamodimo
Botshelo Tsogo Tiroyamodimo
1,575 Points

Question wants me to print out items that only start with an "A" in a given list.Help

I know i have to use a for loop.

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

1 Answer

KRIS NIKOLAISEN
PRO
KRIS NIKOLAISEN
Pro Student 50,902 Points

You can use continent[0] to compare to "A" and if they match print the bulleted continent name as before.