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 Basics (2015) Python Data Types list.remove()

Samuel Girton
Samuel Girton
2,551 Points

I'm having a problem with list.remove challenge task 1 of 2 in Python Basics.

My answer to task 1 was states.remove(5). When I checked my work it said to not change 'states' directly. I've tried as many ways as I know how to solve this problem, but I am not sure if this is a syntax error or if I'm just trying to remove the wrong thing from the list. Any help would be greatly appreciated.

lists.py
states = [
    'ACTIVE',
    ['red', 'green', 'blue'],
    'CANCELLED',
    'FINISHED',
    5,]
states.remove(5)
Brandon Cushman
Brandon Cushman
880 Points

It looks like they don't want you to move the ending bracket. When it gets setup, the bracket is on the next line after 5. Otherwise you did it right.

1 Answer

Steven Parker
Steven Parker
231,271 Points

What they mean is don't change the code provided.

The code you added is fine, but you combined two of the original lines into one. That's what the challenge is complaining about. Just leave the original lines as they are and add your new code after them.