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

Juan Pablo Sierra Useche
Juan Pablo Sierra Useche
1,904 Points

I'm having these error without changing anything: "AssertionError: 7 != 9 : Please don't alter the continents list"

1) These is the code the web had given:

continents = [ 'Asia', 'South America', 'North America', 'Africa', 'Europe', 'Antarctica', 'Australia', ]

2) And it asked me to do these:

Print a bulleted list of each continent from the continents list.

Output should look similar to:

  • Asia
  • South America

3) I complete the task:

continents = [ 'Asia', 'South America', 'North America', 'Africa', 'Europe', 'Antarctica', 'Australia', ] print("CONTINENTS LIST: ") for continents in continents: print("* " + continents)

4) And the next error appeared:

AssertionError: 7 != 9 : Please don't alter the continents list

continents.py
continents = [
    'Asia',
    'South America',
    'North America',
    'Africa',
    'Europe',
    'Antarctica',
    'Australia',
]

print("CONTINENTS LIST: ")
for continents in continents:
    print("* " + continents)
Cheo R
Cheo R
37,150 Points
for continents in continents:

Remove the s on the first continents and off continents in the print statement.

I think the compiler thinks you're trying to reassign the continents variable to keep track of an item in the list continents.

1 Answer

Mustafa Başaran
Mustafa Başaran
28,046 Points

Hello Juan,

in the for loop, you only need to put a placeholder for every item in the continents list. Instead of the actual name of the list, please try continent or i or any other placeholder name. Then it should be OK.

for i in continents:
    print("* " + i)

I hope this helps.