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 trialDavid c
Courses Plus Student 27,988 Pointswhy not working
/
states = [
'ACTIVE',
['red', 'green', 'blue'],
'CANCELLED',
'FINISHED',
5,
]
states.remove('blue')
David c
Courses Plus Student 27,988 Pointsthis is what i have input into challenge. But it returns that there is error with code. I cannot see the error in my above code?
2 Answers
Alexander Davison
65,469 PointsTry using
states.remove(['red', 'green', 'blue'])
instead of:
states.remove('blue')
Good luck! ~Alex
David c
Courses Plus Student 27,988 Pointsin this challenge i have to remove only blue. In your suggestion yours would delete the entire list. But to pass this challenge i must only delete blue
Ryan S
27,276 PointsHi David,
Alex is correct. In the first task it asks you to remove the last item from the states list, which is the number 5. In the second task it asks to you to remove the entire list of colors from the states list. You might be trying to remove the last item from the wrong list.
Good luck.
Alexander Davison
65,469 PointsAlexander Davison
65,469 PointsCan you provide at least a question? Thx. This way the Community can understand about what's your problem.
Not to be mean
Good luck!
~Alex