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

python lists -for in loop

hello . I am not sure how to select the list elements based on letters ):

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

tricks = ['Asia','Africa','Antarctica','Ausralia',]

for wohs in tricks : 
    print (wohs)

1 Answer

Steven Tagawa
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Steven Tagawa
Python Development Techdegree Graduate 14,438 Points

Hi Curtis,

Remember that a string acts like a list of characters. For example, if you had a string like: my_word = "Shazam!" then my_word[0] would be "S", my_word[3] would be "z", and so on. (Remember to start counting at zero!)

So in your challenge, continents is a list of words, so it's really a list of lists. The first word, "Asia", is continents[0], and so the first letter of "Asia" is continents[0][0]. That's how you isolate individual letters in strings.