Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Tinashe Steve Chipangura
1,000 Pointshow do i write the code please help
I'd like you to now only print continents that begin with the letter "A".
HINT: Remember that you can access characters in a string by index
Important: In each task of this code challenge, the code you write should be added to the code from the previous task.
continents.py
continents = [
'Asia',
'South America',
'North America',
'Africa',
'Europe',
'Antarctica',
'Australia',
]
for continent in continents:
print("* " + continent)
continents = [
'Asia',
'South America',
'North America',
'Africa',
'Europe',
'Antarctica',
'Australia',
]
for continent in continents:
print("* " + continent)

nakalkucing
12,964 PointsHi Tinashe Steve Chipangura! Am I correct that you need help with the second part of this challenge?
2 Answers

Caleb Newell
12,562 PointsOk! Thanks for the heads up. i will do better.

Caleb Newell
12,562 Pointsfor the second part you might want to try something like this:
for continent in continents:
if continent[0] == 'A':
print("* {}".format(continent))

Tinashe Steve Chipangura
1,000 Pointsthanks very much hey, it worked

Caleb Newell
12,562 PointsYour welcome. Glad to help :)

nakalkucing
12,964 PointsHey Caleb Newell! I'm glad to see you want to help, that's great. :) I just want to let you know, it is usually frowned on to just give the answer to the challenge without an explanation of why and how it works.
Happy coding!
Yamil Pérez
Courses Plus Student 2,054 PointsYamil Pérez
Courses Plus Student 2,054 Pointsfor continent in continents: print("* " + continent) Your code looks right. you should check he indentation