Python Introducing Lists Using Lists Continental

Shavez Memon
Shavez Memon
Python Development Techdegree Student 2,442 Points

what is wrong here?

Hey, this is my code and I'm getting an error for Task2. I can't figure why. Could you please help?

continents.py
continents = [
    'Asia',
    'South America',
    'North America',
    'Africa',
    'Europe',
    'Antarctica',
    'Australia',
]
# Your code here
for i in continents:
    print ('* {}'.format(i))


for i in continents:
    if i[0] == 'A':
        print(i)

1 Answer

Steven Parker
Steven Parker
201,913 Points

This is the same issue as you had in the other question.

The conditional test should be added into the loop already there. Don't create a second loop.