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 trialMurali B
Courses Plus Student 628 Pointscould 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 = [
'Asia',
'South America',
'North America',
'Africa',
'Europe',
'Antarctica',
'Australia',
]
for cont in continents[0:2]:
print("*" +" "+ cont)
2 Answers
frankgenova
Python Web Development Techdegree Student 15,616 PointsTry printing the whole list in the desired format. The instructions are somewhat misleading.
Murali B
Courses Plus Student 628 PointsThanks Frank, did as suggested ..its working now
frankgenova
Python Web Development Techdegree Student 15,616 Pointsfrankgenova
Python Web Development Techdegree Student 15,616 PointsThe 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.