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 trialRichard Cunningham
1,996 Pointscode right but getting asertion error
dont know why error
continents = [
'Asia',
'South America',
'North America',
'Africa',
'Europe',
'Antarctica',
'Australia',
]
# Your code here
for continent in continents :
print("* ",continent)
4 Answers
Steven Parker
231,269 PointsThe "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.
Richard Cunningham
1,996 PointsI needed to take out the comma and add the + concatenation
Richard Cunningham
1,996 PointsThank you.
where do I get reference to f string here?
Steven Parker
231,269 PointsPython f-strings are covered in one of the courses (not sure which one offhand), but you can also find them in this online documentation.
Richard Cunningham
1,996 PointsThanks
Steven Parker
231,269 PointsSteven Parker
231,269 PointsJust for fun, my personal favorite method is using an "f-string":
print(f"* {continent}")