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)
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,018 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.