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 trialALEX PAYOD
Python Web Development Techdegree Student 1,270 Pointshow to add a list in a list
what does it mean " the last member you should add a list with 2 items in it
my_List=[41,"lll",55,"kkk",66]
my_List.append("alex")
1 Answer
Pete P
7,613 PointsThey meant that my_list should contain: 3 numbers, 2 strings, AND a list with 2 items of your choice inside.
So, my_list will contain a total of 6 items: 3 numbers, 2 strings, 1 list
If placing a list inside of another list is confusing, here is an example:
# my_list contains a string and a list with 2 items
my_list = ["some string", ["item1", "item2"]]
Hope that helps. Let me know if not.