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 will not let me pass, am I doing something wrong.

it's not working.

lists.py
best = [ "popcorn", "cars" , "phone" ]
best.extend (["a", "b"])
best.insert( 1, "start" )

1 Answer

HIDAYATULLAH ARGHANDABI
HIDAYATULLAH ARGHANDABI
21,058 Points

The question wants : Finally, use the .insert() method to place the string "start" at the beginning of your best list. You need to add in the index of 0. because the first element of the list is at the index of 0.

# Finally, use the .insert() method to place the string "start" at the beginning of your best list.
best.insert(0, "start")
Moosa Bonomali
Moosa Bonomali
6,297 Points

The challenges requires him to add the new element to the end of his array. using an index of 0, will add the new items to the beginning of the list

HIDAYATULLAH ARGHANDABI
HIDAYATULLAH ARGHANDABI
21,058 Points

Hello Moosa the question ask to add in the beginning of the list

Moosa Bonomali
Moosa Bonomali
6,297 Points

Yes, you are correct HIDAYATULLAH , I stopped checking at the second stage.

Thanks