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

Terrell Phinazee
Terrell Phinazee
1,675 Points

Need help removing an item

Need help removing item from list

lists.py
states = [
    'ACTIVE',
    ['red', 'green', 'blue'],
    'CANCELLED',
    'FINISHED',
    5,
]
color.remove[("blue")]

1 Answer

Kourosh Raeen
Kourosh Raeen
23,733 Points

Hi Terrell - You're calling remove() on color, but there's no variable called color. Try calling it on the states variable. Now, to remove the list of colors within the states list you need to pass it to remove(), just like when you want to remove 5 you do:

states.remove(5)

Now, do something similar except instead of 5 pass the list of colors to remove().