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.

Justin Lee
Courses Plus Student 593 PointsHow to remove item from list?
not sure what to do
states = [
'ACTIVE',
['red', 'green', 'blue'],
'CANCELLED',
'FINISHED',
5,
]states.remove('blue')
1 Answer

Brett McGregor
Courses Plus Student 1,903 PointsHi Justin,
place the states.remove()
on a new line
if you are trying to remove the nested list, then you'll need to quote the entire list i.e. ['red', 'green', 'blue']
I find I am able to figure these challenges out more easily when I write the code locally on my machine in IDLE and execute the module from there. That way you get the direct error feedback from Python. e.g. when I execute your code above I get syntax error from Python. Any little clue helps!
[MOD: changed from comment to answer - srh]
Steve Hunter
57,684 PointsSteve Hunter
57,684 PointsHi oldergit
I've moved a couple of your comments into answers - keep up the good work and post answers initially; you're mega-helpful!
Thanks for your contributions!
Steve.