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 Combining Lists

It looks like Task 1 is no longer passing. why this show

why this show

lists.py
best=[1,2,'a']
best+[4,'c']
best.extend[5,"def"]
best.append(6,'e')

1 Answer

Vidhya Sagar
Vidhya Sagar
1,568 Points

I am not sure at which challenge you got stuck.,either second or third . First of all .append(any_item)- takes only one argument and that argument will be added on to the end of the list . .extend([any_list])- also takes only one argument which is a list and it will add that list to the list on which the operation is perfomed . .insert(index,item)-takes two arguments ,one at what index do you want to insert the item and second what is the item.

I've added the code below which passes all the three challenges ,but i suggest you try it on your own as lists are one of the most important topics in python.

#First Challenge
best=[1,2,3]
#Second Challenge 
best.extend([4,5])
#Third Challenge
best.insert(0,"start")

thanks for helping me