Welcome to the Treehouse Community
Looking to learn something new?
annika kuntz2,034 Points
How to only get items starting with "A" , printed out of a list
I was thinking about a while or if statement but i cannot figure out how to write a case to only print out the continents starting with the letter "A".
thanks in advance :D
continents = [ 'Asia', 'South America', 'North America', 'Africa', 'Europe', 'Antarctica', 'Australia', ] for i in continents : for str("A") in i : print("* " + i)
The loop will cycle through each word in the list. Check if the first letter of the current word is an A. If it is, print it.
Let me know if this helps here