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

code right but getting asertion error

dont know why error

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

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

4 Answers

Steven Parker
Steven Parker
230,995 Points

The "print" function adds a space between separate arguments, so you don't need to include a space with the asterisk.

You would need the space if you were combining the strings into a single argument using concatenation.

Steven Parker
Steven Parker
230,995 Points

Just for fun, my personal favorite method is using an "f-string":

    print(f"* {continent}")

I needed to take out the comma and add the + concatenation

Thank you.

where do I get reference to f string here?

Steven Parker
Steven Parker
230,995 Points

Python f-strings are covered in one of the courses (not sure which one offhand), but you can also find them in this online documentation.

Thanks