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 trialImmanuel wiessler
2,726 PointsQuestion about Continents problem 2
continents = [ 'Asia', 'South America', 'North America', 'Africa', 'Europe', 'Antarctica', 'Australia', ] for i in continents: check=i if check[0]=="A": print(check)
Is this the correct Answers? It should be right because the system says that it cannot find Asia in my output. However, Asia is being outputted
continents = [
'Asia',
'South America',
'North America',
'Africa',
'Europe',
'Antarctica',
'Australia',
]
for i in continents:
check=i
if check[0]=="A":
print(check)
2 Answers
Pedro Cabral
33,586 PointsThe problem is that you are not printing a bulleted list, you can see that in the error message: AssertionError: '* Asia' not found. You are missing the ul and the "asterisc space". Also keep in mind that the assignment check=i is redundant. You can use i straight away in your code and remove the check all together. Also keep in mind that the variable named i is usually used for numbers/counters, and a more descriptive name would be country. Lastly, you might be interested to know that there is a string method called startswith() that has the same effect as string[0] and is slightly more "readable".
Immanuel wiessler
2,726 PointsThank you for the answer, didn't realise that it asks me to have a bulleted list