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

Jose Camilo
Jose Camilo
6,919 Points

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

Jose Camilo
Jose Camilo
6,919 Points

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

Mark Nembhard
Mark Nembhard
464 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 .