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 trialFELIX OPOKU
656 Pointsplease what is wrong continents = [ 'Asia', 'South America', 'North America',
continents = [ 'Asia', 'South America', 'North America', 'Africa', 'Europe', 'Antarctica', 'Australia', ]
Your code here
print("continents:") for continent in continents: print("*" + continent)
continents = [
'Asia',
'South America',
'North America',
'Africa',
'Europe',
'Antarctica',
'Australia',
]
# Your code here
print("continents:")
for continent in continents:
print("*" + continent)
1 Answer
Scott Bailey
13,190 PointsYou can also try formating when looping through - I'm not sure if it's been covered yet but it's a handy thing to learn.
That way you will know exactly how the string will look when printed out (so you don't miss the space between the * and continent).
for place in continents:
print(f"* {place}")
Zach Stearman
10,913 PointsZach Stearman
10,913 PointsWell, it isn't expecting you to print "continents:" first of all, so I would just delete that line. Secondly, in the example, there is a space after the asterisk, so if you just do this, it should all work out:
print("* " + continent)