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
187,601 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 Web Development Techdegree Student 35,871 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.