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

when i check the work for task 2 on the test, it tells me that task one is no longer passing? why?

this is what I have done... states.remove(5) states.remove([red,green,blue])

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

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 143,922 Points

Hi Valerio,

You are on the right track. This error almost always means you have introduced a syntax or other serious error into the current code which breaks the code checker.

Here, the second line for task two is the problem. You are trying to remove a list with variable names instead of the actual strings that are in the list. You are missing the quotations marks around each color name. Without the quotes, they become variables and are no longer strings. Just fix that up and the rest looks good.

Nice work! :) :dizzy:

thank you very much! I tried that too...eventually I had to copy and paste for it to work out! cheers!