Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

jamie Macdiarmid
2,048 Pointsstuck again.
states.remove (['red', 'green', 'blue'])
Whats wrong now?
states = [
'ACTIVE',
['red', 'green', 'blue'],
'CANCELLED',
'FINISHED',
5,
]
states.remove(5)
states.remove (['red', 'green', 'blue'])
2 Answers

Josh Keenan
19,526 PointsHey Jamie, it's a weird challenge isn't it?
Here's my solution to the challenge, instead of explicitly typing the list you want to remove, I just found the index in the list and removed it that way.
states = [
'ACTIVE',
['red', 'green', 'blue'],
'CANCELLED',
'FINISHED',
5,
]
states.remove(5)
states.remove(states[1])

Ryan Ruscett
23,307 PointsHola,
No worries, you are right and definitely on the right track. The only problem is the space.
states.remove (['red', 'green', 'blue']) < ----- REMOVE the space between removes and the ().
LIKE THIS
states.remove(['red', 'green', 'blue'])
Aside from that, you got it!

jamie Macdiarmid
2,048 Pointsthanks Ryan. Appreciate your time
Ryan Ruscett
23,307 PointsRyan Ruscett
23,307 PointsThis is also a clean way to do it. In a production setting, this would be more accurate. It ensures the list item itself is removed, and not just the values from the list, which in some situations could leave an empty list behind. Which we may or may not want.
jamie Macdiarmid
2,048 Pointsjamie Macdiarmid
2,048 Pointsthanks Josh. much appreciated
jamie Macdiarmid
2,048 Pointsjamie Macdiarmid
2,048 PointsThanks dude. Don't really understand your way but thanks anyway