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

Benjamin Stano
Benjamin Stano
2,742 Points

I'm not sure what this question wants...help!

I really don't understand what's wrong with my answer, maybe I don't understand what the question wants. I'm reading it as: "making a list (my_list) with 3 numbers and 2 strings, then add to it a second list containing any 2 items." But when I try to put that in, as at the time of my answer, it tells me that the final version of my_list must have 6 items, not 7. I think to myself "that makes no sense" but I alter the added list so my_list will have 6 items. Now it tells me I don't have enough! I really don't get it, my code is adding lists together, I can see in the preview items get added to my list. I feel like there must be something really simple I'm overlooking.

lists.py
my_list = [1,2,3,'four','five'];
other_list = [4,'six'];
my_list.extend(other_list);

1 Answer

Possible answer to your question.

Try using

my_list.append(other_list);

A quick google search brought this website up: http://thomas-cokelaer.info/blog/2011/03/post-2/