Holly Bancroft3,545 Points
How did you solve the question "I'd like you to now only print continents that begin with the letter "A"."?
I am trying to figure out how to only list the continents that begin with "A". Could someone show me how they solved this?
continents = [ 'Asia', 'South America', 'North America', 'Africa', 'Europe', 'Antarctica', 'Australia', ] for continent in continents: print("* " + continent)
KRIS NIKOLAISEN54,333 Points
There is a hint: Remember that you can access characters in a string by index. For your code you would use
continent to access the first character of
continent (the index starts at 0).
Then use an if statement and compare this to "A" and if they match print your bulleted list item.