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

jefffromcali
jefffromcali
649 Points

I am using the my_list.extend(my_list2) to add the last item and I continue to get a "didn't find enough items error"

Does anyone have any suggestions? Thank you.

lists.py
my_list = []

my_list.append(1)
my_list.append(2)
my_list.append(3)
my_list.append('string1')
my_list.append('string2')

my_list2 = ['thing1', 'thing2']

my_list.extend(my_list2)

2 Answers

Extend will add the items to the list as individual items. The last part of the instructions want you to insert a list of two items into the original list.

jefffromcali
jefffromcali
649 Points

thanks adam n - I did end up using the append method instead of extend. I didn't know you could append an entire list . . .

You can mark this question as solved by selecting a "best answer". :smile: