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 Python Collections (2016, retired 2019) Lists Creating lists

I don't know how to add a list inside a list.

I tried many different ways of doing this until I came across this one which is clearly wrong. Could you please explain to me how and why? Thanks

lists.py
my_list = ['3', '2', '1' 'hi', 'bye']
mys = ['reel', 'cake']

my_list = my_list.append(mys)

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,441 Points

Very close. The challenge is looking for three numbers not a string with a numeral character. Remove the quote from around the numbers.

Edit: also, assignment to my_list is not necessary. append() alters a list in place:

? my_list.append(mys)