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

Ravi Kumar Pokkuluri
PLUS
Ravi Kumar Pokkuluri
Courses Plus Student 543 Points

The below task is not getting executed as it shows the error the task 1 is no longer passing

The question in the task says to remove the second item from the list where as the error that I receive is it looks like task 1 is not longer passing.

I am not sure if I have executed the script correctly. could any one help.

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

2 Answers

Steven Parker
Steven Parker
231,271 Points

The code added for task 1 seems to be missing! Perhaps you deleted it by accident while working on task 2? Remember the challenge warning: "Important: In each task of this code challenge, the code you write should be added to the code from the previous task."

Also, you may have trouble with the space between the function name and the open parenthesis. The language itself may tolerate that, but the challenge can be extra picky.

Viraj Deshaval
Viraj Deshaval
4,874 Points

This is because you need to pass the first task as well. Try to remove no. 5 and the try to remove colours list. I can see space in your code between remove and start of brackets so get rid of that too.