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

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 145,860 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!