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 trialLauritz Patterson
1,207 PointsIm not sure where I'm going wrong here
I feel that this is simple but what is wrong?
continents = ['Asia', 'South America', 'North America', 'Africa', 'Europe', 'Antarctica', 'Australia']
# Your code here
for continent in continents:
print("*" + continents)
2 Answers
Alexander Davison
65,469 PointsI notice two bugs:
- You are using concatenation (adding strings together), so the strings will be glued together without spaces.
-
You are attempting to add the string
"*"
andcontinents
together. Butcontinents
is a list! :/
To fix the bugs, try...
for continent in continents:
print("* " + continent)
Shadd Anderson
Treehouse Project ReviewerYour issue is here in the print method:
for continent in continents:
print("*" + continents)
continents
is the list of continents, not the actual continent
that has been selected in the for loop. Simply erase the extraneous s at the end like so:
for continent in continents:
print("*" + continent)
and you'll be good to go!
Alexander Davison
65,469 PointsSorry Shadd, but there's one more bug in his code ;)
(Remember: code challenges are picky about spacing!)
Shadd Anderson
Treehouse Project Reviewerah, I didn't even realize this was for a code challenge. lol! Whoops