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 trial

Python Python Basics (2015) Python Data Types list.remove()

How to solve this task?

How to solve this task?

lists.py
states = [ 'ACTIVE',['red', 'green', 'blue'],'CANCELLED','FINISHED',5,]

states.remove[5]

5 Answers

states = [ 'ACTIVE',['red', 'green', 'blue'],'CANCELLED','FINISHED',5,]

states.remove(5)

this is also not working

james south
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
james south
Front End Web Development Techdegree Graduate 33,271 Points

in 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.

No buddy, states.remove(5) is showing error, please check

james south
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
james south
Front End Web Development Techdegree Graduate 33,271 Points

i 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?

It states that remove is not defined