Python Introducing Lists Using Lists Continental

Sam Cerwinske
Sam Cerwinske
Pro Student 2,016 Points

print only continents

I'm struggling to figure this out. I can't seem to get this code to work. Halp?
continents = [
    'South America',
    'North America',
for continent in continents:
    first_index = (continent[0:1:1]).lower()
    if first_index == "A":

1 Answer

Stivan Radev
Stivan Radev
6,998 Points
# Here is how to do it
for continent in continents:
    # if the first letter of continent is == 'A', then print it
    if continent[0] == 'A':
        print(f'* {continent}')