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 trialAlistair Murphy
743 PointsWhat to remove ? and how? i'm doing .remove () :S
Tried alot of things to remove with "states" being the list name and with out. its unclear and i'm getting syntax error a lot that i'm not sure why .
states = [
'ACTIVE',
['red', 'green', 'blue'],
'CANCELLED',
'FINISHED',
5,
states .remove ['blue']
4 Answers
Susannah Klanecek
5,825 Pointssince you are calling the remove()
method on states
you should remove the space between the 2, also it should be remove(something)
not remove [something]
, if you are removing list items then you would do some_list.remove([1, 2])
Alistair Murphy
743 PointsI have adjusted accordingly e.g states.remove (5)
But now its just saying - Did you use .remove()
?
Susannah Klanecek
5,825 Pointsyou still have a space in states.remove (5)
it should be states.remove(5)
Alistair Murphy
743 PointsOh yeah, spot on Susanna not used to such precise matters. will learn though :) all good !!!