Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Introducing Lists Using Lists Continental

Albaraa Maktabi
Albaraa Maktabi
1,649 Points

I can't understand "Please don't alter the continents list" error, I didn't even touch it!!

...

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

1 Answer

Steven Parker
Steven Parker
231,198 Points

You need to choose a different name for the loop variable. Using "continents" as both the iterator and loop variable causes it to be overwritten at the beginning of the loop.

for continents in continents:
#   ^^^^^^^^^^    ^^^^^^^^^^
#   loop var      iterator