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

could someone pls help on what's wrong with the code

out of 6 list items, display the first 2 items pls review my code and let me what's wrong with my code

continents.py
continents = [
    'Asia',
    'South America',
    'North America',
    'Africa',
    'Europe',
    'Antarctica',
    'Australia',
]
for cont in continents[0:2]:
    print("*" +"  "+ cont)

The actual instructions do not specify displaying only the first 2 items in the list. The instructions only say:

"Print a bulleted list of each continent from the continents list. Output should look similar to:"

They give you the first two items in the list as examples of what they want the whole list to look like. They actually want you to print the entire list using the format they show.

2 Answers

Try printing the whole list in the desired format. The instructions are somewhat misleading.

Thanks Frank, did as suggested ..its working now