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 trialentrepreneur
458 PointsKinda Confused on the second Task
I've been on this question for a while and tried many things . Any tips or suggestions ?
continents = [
'Asia',
'South America',
'North America',
'Africa',
'Europe',
'Antarctica',
'Australia',
]
# Your code here
for continent in continents:
print("*", continent)
"A" in continent
2 Answers
Jose Camilo
7,031 PointsEach of those strings have an index. Iterate through each one of them and get the ones which indexes starts with "A".
You are very close. use an If statement and then print
Mark Nembhard
1,387 PointsI tripped up on this and i keep going through the videos leading up to this without any decisive ( i think at least ) " this is how you do it " solution. My instinct is telling me this If continent. (what ever method tests first character)=="A" then print continent.
Jose Camilo
7,031 Pointsif word[index at 0] == "A" then print
Mark Nembhard
1,387 PointsThanks for your help. I think there is a little jump in what has been taught and what you need to know to answer that question. I managed it in the end. Created another loop used the looping variable and made the variable a list (made up of the letters that made the continent and used BOOLEAN ALGEBRA
entrepreneur
458 PointsThank you guys for answering. I actually solved it from another post that day .
entrepreneur
458 Pointsentrepreneur
458 PointsThis is what the question ask "I'd like you to now only print continents that begin with the letter "A".