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)
![Randolph Davidson](https://secure.gravatar.com/avatar/6e35c8bd7cc20e311f083c728e468b97?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Randolph Davidson
1,117 PointsIs this challenge broken? I don't understand why it's printing out extra information.
I am doing the introducing list python challenge task 2 of 2. In my code below I have tried several different ways of solving this challenge (they are all there for example purposes). With a loop which for some reason prints of Europe, with an if statement that states A continent that does not start with A was found. And then I called the index and the same issue. Am I doing something wrong.
Any ideas on this issue? I thank any and everyone in advance.
continents = [
'Asia',
'South America',
'North America',
'Africa',
'Europe',
'Antarctica',
'Australia',
]
# Your code here
for continent in continents:
print(" * " + continent)
for A in continents:
print(continents)
print(len(continents))
print(continents[0])
print(continents[3])
print(continents[5])
print(continents[6])
if continents == "A":
print(continents)
3 Answers
![Robert Gulley](https://uploads.teamtreehouse.com/production/profile-photos/11554217/micro_me.jpg)
Robert Gulley
Front End Web Development Techdegree Student 10,722 PointsThere should only be one print statement. Also make sure there is no space between continent and [0].
for continent in continents:
if continent[0] == "A":
print("* " + continent)
![Robert Gulley](https://uploads.teamtreehouse.com/production/profile-photos/11554217/micro_me.jpg)
Robert Gulley
Front End Web Development Techdegree Student 10,722 PointsHi Randolph! -
Remember that you can access characters in a string by it's index. Since we want to know the first character, we would reference the 0 index. Therefore, inside the for loop, we would have an if statement that checks the first index, and if it equals "A", we print the result, like below:
# Your code here
for continent in continents:
if continent[0] == "A":
print(" * " + continent)
This is all the code that you need to complete the challenge.
Hope this helps!
![Randolph Davidson](https://secure.gravatar.com/avatar/6e35c8bd7cc20e311f083c728e468b97?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Randolph Davidson
1,117 PointsHello Robert Gulley thanks for answering. I should have added that I did that as well. I still get the error that it looks like an continent that does not start with A was included.
continents = [ 'Asia', 'South America', 'North America', 'Africa', 'Europe', 'Antarctica', 'Australia', ]
Your code here
for continent in continents: print(" * " + continent) if continent [0] == "A": print("+ " + continent)
![Randolph Davidson](https://secure.gravatar.com/avatar/6e35c8bd7cc20e311f083c728e468b97?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Randolph Davidson
1,117 PointsApologies in advance for the poor clarity in grammar.
Randolph Davidson
1,117 PointsRandolph Davidson
1,117 PointsRobert Gulley Thanks so much, I cannot believe I didn't catch that lol. It passed now.