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 trial

Python Introducing Lists Using Lists Continental

Kinda Confused on the second Task

I've been on this question for a while and tried many things . Any tips or suggestions ?

continents.py
continents = [
    'Asia',
    'South America',
    'North America',
    'Africa',
    'Europe',
    'Antarctica',
    'Australia',
]
# Your code here
for continent in continents:
    print("*", continent)
"A" in continent

This is what the question ask "I'd like you to now only print continents that begin with the letter "A".

2 Answers

Each 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
Mark Nembhard
1,387 Points

I 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.

if word[index at 0] == "A" then print

Mark Nembhard
Mark Nembhard
1,387 Points

Thanks 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

Thank you guys for answering. I actually solved it from another post that day .