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

David Garcia
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
David Garcia
Python Development Techdegree Graduate 11,254 Points

i forgot how to access a character in a string by index i must of forgotten to wright it down in my notes .

I dont under stand how to do this second part i missed it i guess. but i need to get the continents that start with 'a' to be reiterated or access a character in a string by index..

continents.py
continents = ['Asia', 'South America', 'North America', 'Africa', 'Europe', 'Antarctica', 'Australia']
# Your code here

for continent in continents:
    print("* ".format([0][3][5][-1]) + continent)

1 Answer

You'll need an if statement to check that the first letter is 'A', then print only those continents.

for continent in continents:
    if continent[0] == 'A'
        print("* " + continent)
David Garcia
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
David Garcia
Python Development Techdegree Graduate 11,254 Points

Thank you very much i have added this into my notes and now i understand what was needed to be done! also you forgot the " : " in your code but that's no problem

Whoops! I'm sorry about that. I'm glad you knew better!