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 (Retired) Lists Redux Manipulating Lists

Challenge Error

I was getting an error here as well

the_list = ["a", 2, 3, 1, False, [1, 2, 3]]

# Your code goes below here

the_list.insert(0, the_list.pop(3))

list=[5, 4, 1]

for numbers in list:
  del the_list[numbers]

the_list.extend(range(4,21))

Error: Traceback (most recent call last): File "4fd7aca7-edd9-4f26-bb1e-8f7ba011333e.py", line 105, in """) File "", line 2, in TypeError: 'list' object is not callable

I tested the script in workspace and it works fine for me.

lists.py
the_list = ["a", 2, 3, 1, False, [1, 2, 3]]

# Your code goes below here

the_list.insert(0, the_list.pop(3))

list=[5, 4, 1]

for numbers in list:
  del the_list[numbers]
the_list.extend(range(4,21))

2 Answers

it is because you have used a keyword list as a variable.. i changed your list variable to new_list and it worked!

The same exact code works fine in workspace.