Python Introducing Lists Using Lists Continental

kudakwashe jamu
kudakwashe jamu
7,986 Points

Print a bulleted list of each continent from the continents list. Output should look similar to:

how do l solve this

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

2 Answers

Darryl Mah
Darryl Mah
5,446 Points

You’ll want to loop through the continents array. :) the system is also very precise on making sure the string matches with spaces and capitalization.

The code should look something like:

for continent in continents: print(“* “ + continent)

If you want to be fancy, shorten your code a little, you can use string interpolation.

Tshoganyetso Masisi
Tshoganyetso Masisi
4,780 Points

i did it like this but i am getting an AssertionError.....Its saying "not finding the correct items in your output......what am i doing wrong?

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