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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![jesus moreno](https://secure.gravatar.com/avatar/ab2bed9a1966dc7f12b92ba83d0b651b?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
jesus moreno
447 PointsI can someone give me a clue or explain how it'sdone?
If someone provides an answer for this code. can you explain it, please?
continents = [
'Asia',
'South America',
'North America',
'Africa',
'Europe',
'Antarctica',
'Australia',
]
for continent in continents[0:3:5:6] :
print(continents)
1 Answer
![ygh5254e69hy5h545uj56592yh5j94595682hy95](https://secure.gravatar.com/avatar/f6e142ba5d193d561936bdc6b508775f?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
ygh5254e69hy5h545uj56592yh5j94595682hy95
7,934 PointsHey man, if you remember in the previous tutorials, there is a way to retrieve the first character from a string. Here is how to do it
ps. this [0:3:5:6] I would not recommend you doing that because say for example they give you a random data that you can't see. this making this [0:3:5:6] unnecessary.
for continent in continents :
# This is how you get the first character from a string
# Ex.: A, .lower() just makes the letter a lower case
# thus making the if statement true and printing the continent that begins with the letter 'A'
if continent[0].lower() == 'a':
print('*', continent)
hope this helps
jesus moreno
447 Pointsjesus moreno
447 PointsThanks!!! I had this in mind but I was not sure if I was right. Thanks for your help!