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 trialFranz Hinterkoerner
5,021 PointsAssertionError in code challenge (for...in iteration through list
Hi,
here the question I have trouble with:
'Print a bulleted list of each continent from the continents list.
Output should look similar to:
- Asia
- South America'
Here the respective list:
continents = ['Asia', 'South America', 'North America', 'Africa', 'Europe', 'Antarctica', 'Australia']
Here my answer:
continents = ['Asia', 'South America', 'North America', 'Africa', 'Europe', 'Antarctica', 'Australia'] for continent in continents: print("* " + continent)
Error Message:
'Bummer: AssertionError: '* Asia' not found in 'Asia\nSouth America\nNorth America\nAfrica\nEurope\nAntarctica\nAustralia' : Hmm...not finding the correct items in your output'
My logic seems fine, how come that 'continent' can't be set to 'Asia' (or any other item in the list) ?
Thanks!
continents = ['Asia', 'South America', 'North America', 'Africa', 'Europe', 'Antarctica', 'Australia']
for continent in continents:
print(continent)
2 Answers
Franz Hinterkoerner
5,021 PointsHi Adam,
apologies for the confusion, the following was my answer yesterday/is my answer today:
'continents = ['Asia', 'South America', 'North America', 'Africa', 'Europe', 'Antarctica', 'Australia'] for continent in continents: print("* " + continent)'
For some reason, today no error message...? The error seems to have been on TH side, is resolved - thanks for the quick reply Adam!:)
Franz
Adam N
70,280 PointsAre you putting an asterisk in front of each continent?
Your post has two sets of code, and I'm not sure which one you consider your answer here.
Adam N
70,280 PointsAdam N
70,280 Pointsnp! You can mark this question as solved by choosing a "best answer".