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 trialNursultan Bolatbayev
16,774 PointsStruggle in Python basics - list.py exercise, question 2
Hello. Here I do this: states.remove(['red', 'green', 'blue']). It doesnt work. But the same code I checked on workspace it worked
states = [
'ACTIVE',
['red', 'green', 'blue'],
'CANCELLED',
'FINISHED',
5,
]
states.remove(5)
3 Answers
Jennifer Nordell
Treehouse TeacherYour code looks correct to me. Make sure you aren't removing the code from the previous challenge to remove the 5. If you do, the challenge fails even if the remove red, blue green is correct.
These are the two lines that passed for me in the last step which look like yours.
states.remove(5)
states.remove(['red', 'green', 'blue'])
If it still fails, try refreshing your browser and start the challenge again.
Florian Tönjes
Full Stack JavaScript Techdegree Graduate 50,856 PointsHey Nursultan,
your code should work.
This completed the challenge:
states = [
'ACTIVE',
['red', 'green', 'blue'],
'CANCELLED',
'FINISHED',
5,
]
states.remove(5)
states.remove(['red', 'green', 'blue'])
Kind Regards, Florian
Nursultan Bolatbayev
16,774 PointsThank you, guys. Got it, now it works!
Nursultan Bolatbayev
16,774 PointsNursultan Bolatbayev
16,774 PointsThe question asked to remove second item, which is list of colors