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

stuck no answers available for this

I cant figure this one out

lists.py
best=["apple","peach","mango"]
best.extend=["banana","cherry"]

best = ["car", "chocolate", "wine", "cars"]

best.extend(["banana", "cherry"])

3 Answers

extend is a method. try:

best.extend(["banana","cherry"])

this has not passed

my question is best has 2 items if counting 0,1,2

first line add another item, still didn't accept

is this a trick question, as the counting asks for 3 but python counts from 0?

how many subjects do you need in the first line? and the second line? recap([, bracket and square bracket? string and list?

In your original post best has three items. Each word is an item. 0,1,2 are indexes for items 1,2,3.

I tried the following and it passed:

best=["apple","peach","mango"]
best.extend(["banana","cherry"])