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()

Need assistance with .remove argument

What am I doing wrong here? When I check my work it states that task 1 "is no longer working". Task 1 was the states.remove(5).

states = [ 'ACTIVE', ['red', 'green', 'blue'], 'CANCELLED', 'FINISHED', 5, ] states.remove(5) states.remove(['red', 'green', 'blue])

states = [
    ['red', 'green', 'blue'],
states.remove(['red', 'green', 'blue])

2 Answers

Steven Parker
Steven Parker
229,708 Points

Any syntax error will invalidate the entire code and cause the re-checks of previous tasks to fail.

In this case it looks like you're just missing the closing quote at the end of the word 'blue'.

Alex Koumparos
Alex Koumparos
Python Development Techdegree Student 36,887 Points

Hi Raymond,

Don't pay too much notice to when Treehouse says that now a different task is no longer working. In almost all cases, the problem is only in the current task but the Treehouse parser is getting confused.

This is true here where your answer to the previous task is still correct, but your error is in the current task. If you look closely at the list you are removing from the parent list, you'll notice that you are missing the closing quote from one of the strings.