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()

Nathan Dobbs
Nathan Dobbs
9,886 Points

I have no clue where to start. Everything I've tried returns an error and I've watched the list video multiple times.

define the list

lists.py
states = [
    'ACTIVE',
    ['red', 'green', 'blue'],
    'CANCELLED',
    'FINISHED',
    5,
]

1 Answer

Hi there,

To use the .remove method, you start with the name of the list (states), then add .remove(). Inside the parentheses, you place the value you want it to remove - in this case, it asks you to remove the last item, which is 5. So, you get:

states.remove(5)

Adding that to the bottom should pass the first step. The second step will ask you to remove another value - see if you can figure that one out. Make sure you don't delete any of the previous code - just add to the bottom, and remember that you just have to put what you want it to remove in the parentheses - good luck!