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

Alistair Murphy
Alistair Murphy
743 Points

still stuck on this, please somebody "did you use .romove () error ?

put me out of my misery i beg xD

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

1 Answer

andren
andren
28,558 Points

There are two issues:

  1. The first task asks you to remove the number 5 from the list, you are not doing that in your current code which is an issue since you need to keep the code from each task around in multi-task challenges like this.

  2. The challenge checker can at times be pretty picky about how your code looks. It doesn't like the fact that you have a space between the remove method and its parenthesis, so you have to remove that space.

If you fix those two issues like this:

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

Then you will be able to pass the challenge.

Alistair Murphy
Alistair Murphy
743 Points

Thank you, yeah moments after posting this i adjusted the space and got it and the following :)