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

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!