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 trialChristian Johnson
Python Web Development Techdegree Student 2,222 PointsI can't get the challenge to pass even though I've done what was asked I'm not sure what is wrong.
Hi
It states to print out the continents that begin with a which I've done. But does not pass. PS the one I'm having a problem with is the 2nd challenge that you must print out a continent that starts with A.
Thanks Christian
continents = [
'Asia',
'South America',
'North America',
'Africa',
'Europe',
'Antarctica',
'Australia',
]
# Your code here
for i in continents:
print(f"* {i}")
if i[0] == "A":
print(f"* {i} begins with the letter A"
2 Answers
KRIS NIKOLAISEN
54,971 PointsFor task 2 you should only have one print statement. And that should just print the bullet and continent. Otherwise you are on the right track.
Christian Johnson
Python Web Development Techdegree Student 2,222 PointsOh okay that for it to pass it must be the bullet + continent. Thank you
Manuel Canario
1,458 PointsI'm kind of lost: We haven't discussed any "f" as a function so far. This is what I have but it keeps nagging me about indentation.
continents = [ 'Asia', 'South America', 'North America', 'Africa', 'Europe', 'Antarctica', 'Australia', ]
Your code here
for continent in continents: if continent(0) == 'A': print("* "+ continent)
Christian Johnson
Python Web Development Techdegree Student 2,222 PointsHi Manuel
Sorry for the late reply, the f in front of the string is a trick I picked up on my past years of journeying through python. It basically is just telling the string it will be formatted (ie: print("The {} dog runs!".format(dog_color)) => print(f"The {dog_color} dog runs!")). The challenge could be worded better it's a little confusing the output it wants is this:
- Asia
- Africa
- Antarctica
- Australia
Michael Cook
Full Stack JavaScript Techdegree Graduate 28,975 PointsMichael Cook
Full Stack JavaScript Techdegree Graduate 28,975 PointsPrepare for a lot of frustration. The python challenges are buggy and IMHO the instructor is even worse. I eventually just stopped taking python courses on Treehouse and started learning PHP instead. More web jobs in it anyway.