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 trialBrian Elinsky
4,087 PointsWhat is wrong with my code?
My output looks correct. Maybe there's a bug in treehouse?
These are the treehouse instructions: Print a bulleted list of each continent from the continents list. Output should look similar to:
- Asia
- South America
continents = [
'Asia',
'South America',
'North America',
'Africa',
'Europe',
'Antarctica',
'Australia',
]
# Your code here
for continent in continents:
print("* ", continent)
1 Answer
Jennifer Nordell
Treehouse TeacherHi there, Brian Elinsky ! Nope, it's not a bug in Treehouse, but your code is sooooo close that it's hard to even see the difference. In your print
statement, you had the forethought to include a space to account for the space between the asterisk and the continent
. However, when you use print
and then separate a string with a comma and then a variable name a space will be added by default. This means that between your asterisk and your continent
there is not one space... but two.
You wrote:
print("* ", continent)
But that should be:
# note the omission of the space after the asterisk
print("*", continent)
Hope this helps!
Brian Elinsky
4,087 PointsBrian Elinsky
4,087 PointsThanks! That was driving me crazy!