Python Introducing Lists Using Lists Continental

Oleksandr Krasnovskyy
Oleksandr Krasnovskyy
3,312 Points

IndentationError: expected an indented block

What's wrong with my code? ANybody help

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

1 Answer

Steven Parker
Steven Parker
170,377 Points

To be considered inside the loop, the "if" line must be indented more than the "for" line.

And the "print" line will still need to be indented more than the "if" line.