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 trialAshish Shah
1,468 PointsHow to solve this task?
How to solve this task?
states = [ 'ACTIVE',['red', 'green', 'blue'],'CANCELLED','FINISHED',5,]
states.remove[5]
5 Answers
james south
Front End Web Development Techdegree Graduate 33,271 Pointsremove is a method so the argument you give it goes in parens () not brackets []. brackets are for slice notation.
Ashish Shah
1,468 Pointsstates = [ 'ACTIVE',['red', 'green', 'blue'],'CANCELLED','FINISHED',5,]
states.remove(5)
this is also not working
james south
Front End Web Development Techdegree Graduate 33,271 Pointsin the first task you are passing the actual element to the remove method (it is one way that will work). so states.remove(5) will remove the 5 from the list and you will pass task 1. in task 2 it wants you to remove the list of colors. you can again pass the actual element, the list of colors, as the argument for remove, or use slice notation to identify the element in the states list to be removed.
Ashish Shah
1,468 PointsNo buddy, states.remove(5) is showing error, please check
james south
Front End Web Development Techdegree Graduate 33,271 Pointsi just passed task 1 again with states.remove(5). in all the challenges, if it says a previously passed task no longer passes, it is usually because of an error in the way you are answering a later task. i just passed task 2 again without changing what i had put for task 1. what are you putting for task 2?
Ashish Shah
1,468 PointsIt states that remove is not defined