Python Introducing Lists Using Lists Continental

Marek Ostrowski
Marek Ostrowski
2,449 Points

printg 2 fisr arguments from list using for in statement

Hi I have stucked in continents.py

I can not modify continents list I have to print only 2 first arguments using for in statement

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

for cont in continents:
    print("* ",cont)

1 Answer

KRIS NIKOLAISEN
KRIS NIKOLAISEN
53,389 Points

If by first two arguments you referring to:

Output should look similar to:

  • Asia
  • South America

the first task wants you to print all continents. You are close but by including a space and comma in your print function you will end up with two spaces between the bullet and the continent name.

This:

for cont in continents:
    print("* ",cont)

should be:

for cont in continents:
    print("*", cont)

Using the comma will add the needed single space

Marek Ostrowski
Marek Ostrowski
2,449 Points

Thank you, for quick response that worked!