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

Ricardo Franco
seal-mask
.a{fill-rule:evenodd;}techdegree
Ricardo Franco
Data Analysis Techdegree Student 16,258 Points

Someone check my code please

I am stumped as to why the 2nd task of my code is not successfully passing. When I refresh the right half of the screen, my output displays the output correctly according to instructions and only displays the continents that start with an "A". However, I am getting an Assertion Error that is inhibiting me from progressing. Thank you, in advance, for your time and assistance.

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

for continent in continents:    
    if continent[0] == "A":
        print(continent)
Francesco Vertemati
Francesco Vertemati
8,223 Points

Hi Riccardo,

I think you still have to include the bullet with space "* " before the continent name.

Ricardo Franco
seal-mask
.a{fill-rule:evenodd;}techdegree
Ricardo Franco
Data Analysis Techdegree Student 16,258 Points

Thank you, Francesco...I really appreciate your time and help. I knew I was close. I just misunderstood the instructions, I suppose.

1 Answer

Steven Parker
Steven Parker
231,198 Points

You should have only one loop throughout the challenge. For task 2, you just modify it to be selective.