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 trialRaul Cisneros
7,319 PointsSelecting all list items that begin with the letter "A".
I have spent enough time trying to figure this out. I am not looking for a hint, I am looking for the solution. Can anyone help?
continents = [
'Asia',
'South America',
'North America',
'Africa',
'Europe',
'Antarctica',
'Australia',
]
# Your code here
for continent in continents.index("A")
print('* ' + continent)
2 Answers
jhon white
20,006 Pointsfor continent in continents: if 'A' in continent[0]: print('* ' + continent)
1- index(), It is just return the first value in sq match to its arg.So , you don't need it here. 2-you need to use (:) by the end of your for loop.
Good luck!!
jhon white
20,006 PointsYou are welcome. We all here to learn :) Good luck!!
Raul Cisneros
7,319 PointsRaul Cisneros
7,319 PointsIm sure to most people this was an easy one, but being new to python I couldn't figure it out. Thank you so much! I definitely wont forget this one!