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

Nicholas Dallas
Nicholas Dallas
2,691 Points

Indexing on the Continents part 2

I don't know if my spacing is off in this or if it is the formatting. I rewatched the Indexing video a bunch and have rewatched mostly all of the List Videos.

if anyone has an answer on what I'm doing wrong, please share.

Thanks, Dallas

continents.py
continents = [
    'Asia',
    'South America',
    'North America',
    'Africa',
    'Europe',
    'Antarctica',
    'Australia',
]
print("continents with A's: {}".format)

print("{}".format(continents[0]))
print("{}".format(continents[3]))
print("{}".format(continents[-2]))
print("{}".format(continents[-1]))

for continent in continents:
    print()

2 Answers

continents = [
    'Asia',
    'South America',
    'North America',
    'Africa',
    'Europe',
    'Antarctica',
    'Australia',
]

for continet in continents:
    if continet[0]== "A":
        print("* " + continet)
                              ```

the spacing should look like this *ignore the tick mark at the end hope this helped:)

Nicholas Dallas
Nicholas Dallas
2,691 Points

Sean,

Thank you for the response! I see how the spacing can be so critical. Totally forgot about the 4 space rule!

Thank you for the response in the actual perfect EX form above! I was able to really pick up on how the spacing should be.

Clean!! thank you!

you can say for continent in continents if continent[0] == 'a': print (continent)

Nicholas Dallas
Nicholas Dallas
2,691 Points

for continent in continents: if continent[0] == "A": print(continent)

when I put that into the comp is still says that it can't locate.

"Bummer: AssertionError: '* Asia' not found in 'Asia\nAfrica\nAntarctica\nAustralia' : Hmm...not finding the correct items in your output"

is my spacing wrong?