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 trialShane Smith
Python Development Techdegree Student 2,550 PointsGenuinely lost on this one!
I am struggling in general to recall the information to complete this quiz. I have re-watched all the info in this section and cant seem to find the info to complete this. Im just looking for a reference to information I can use to complete this problem or some sample code to jump start me on completing this. (The question pertaining to this code is in the top right corner under "View Challenge") Thank you in advance!!
continents = [
'Asia',
'South America',
'North America',
'Africa',
'Europe',
'Antarctica',
'Australia',
]
for continent in continents:
print("* " + continent)
3 Answers
rydavim
18,814 PointsIt looks like your code for the first task is complete and correct, so I'm assuming you're referring to the second part of the challenge. You'll need to check if the first character is A before printing.
Real Python has a good reference for all the basic string functions - including how to select by index.
If that doesn't help, let me know and we can try some hints to get you started. Good luck, and happy coding!
Update (Sep 24, 2020):
It looks like you two may still be having some trouble. Here is some additional pseudo-code to get you going.
for continent in continents:
# check if the first character matches what you're looking for.
# if item[index] == 'char value':
print("* " + continent)
Jenn Giulietti
4,888 PointsAwesome, thanks for the update
Jenn Giulietti
4,888 PointsShane Smith I am having the exact same problem. I am completing it the same way and cannot get to the next step and don't fully understand the error code. Did you work it out?
Shane Smith
Python Development Techdegree Student 2,550 PointsI have not, I skipped it and it hasnt come up again yet in the next few courses on the track like I was hoping it would. If and when I go back to solve it I will make sure to follow up :)
rydavim
18,814 Pointsrydavim
18,814 PointsI've updated my post to include some pseudo-code. If you still feel stuck, we can walk through a complete solution. Keep at it! 😊
Shane Smith
Python Development Techdegree Student 2,550 PointsShane Smith
Python Development Techdegree Student 2,550 Pointsthank you this does help! I am going to give it a shot!
Shane Smith
Python Development Techdegree Student 2,550 PointsShane Smith
Python Development Techdegree Student 2,550 PointsOk so I cant seem to reference the index of the first letter. I BELIEVE my code is checking the first item in the list vs the fist letter in the item in the list? Sorry if that doesn't make sense. First week here!
rydavim
18,814 Pointsrydavim
18,814 PointsYou're nearly there. The challenge is looking for all of the continents that start with A, rather than S. The code syntax looks good, though! Nice job!
Shane Smith
Python Development Techdegree Student 2,550 PointsShane Smith
Python Development Techdegree Student 2,550 Pointswow, not sure how i missed that haha TYVM! SOLVED!!!!