Python Introducing Lists Using Lists Continental

Faraz Jahangiri
Faraz Jahangiri
963 Points

How do I output the continents that begin with the letter A?

This is the code I am using, could someone help me to output the continents that begin with A??

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

1 Answer

Scott Bailey
Scott Bailey
13,168 Points

After your for statement, (indented) you should try using an "if" statement to compare the first letter of the continent (continent[0]) is equal to "A".

See if you can figure it from that, I'm not great at describing these ideas well

If you need any more help let us know!