Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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

How do I get passed "Opps Task1 is no longer passing"?

I'm trying to pass this 2nd and final task of this challenge and I keep getting this stupid error message "Opps Task1 is no longer passing." How do I get passed this? This is very frustrating now, and I need help!!

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

1 Answer

Hi there,

When you're doing challenges, you generally want to keep your code from the other tasks unless it specifically tells you to remove it. You're getting "Task 1 is no longer passing" because it looks like you've removed the code that made it pass (states.remove(5)). Keep that one there, and do this one in a new states.remove() line.

Now, for this step - it's asking that you remove the list of colors. Since .remove() will look for the value you put inside of it, you just need to put that list of colors in. It'll look like this:

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

So, to keep Task 1 passing and to do this step, your whole thing should look like this:

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

Hope this helps!