Chris BoguesPython Web Development Techdegree Student 537 Points
How can I print only the letter A
Hello - I'm a little confused on how I can select certain continents. If I do 'continents ', I get the first letter. How can I select the ones with the letter A?
continents = [ 'Asia', 'South America', 'North America', 'Africa', 'Europe', 'Antarctica', 'Australia', ] # Your code here for continent in continents: print("* " + continent)
Chris FreemanTreehouse Moderator 56,951 Points
What if you use
continent as an
if statement condition, then print whole name?
Post back if you need more help. Good luck!!!
Edin Gunic1,564 Points
I struggled with this one a bit but reading Chris's answer was a lot of help. Here is what worked for me:
continents = [ 'Asia', 'South America', 'North America', 'Africa', 'Europe', 'Antarctica', 'Australia', ]
for continent in continents: if continent == "A": print("* " + continent)