Python Introducing Lists Using Lists Continental

Mohamed Ali
Mohamed Ali
2,922 Points

Index

I'd like you to now only print continents that begin with the letter "A". HINT: Remember that you can access characters in a string by index

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

1 Answer

Brendan Whiting
MOD
Brendan Whiting
Front End Web Development Treehouse Moderator 82,568 Points

Before you print out each continent, it wants you to check if the first letter of the continent is "A". I recommend using an if block.

They also gave you a good hint: "HINT: Remember that you can access characters in a string by index".

Let me know if you need more help.