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

Johan Berg
PLUS
Johan Berg
Courses Plus Student 5,352 Points

"You should have used `.remove()` twice now." Odd error message appears for the Python list remove code challenge

I followed the instructions to the challenge, but despite this, I keep receiving an error message informing me that "You should have used .remove() twice now." I have no idea why this message appears, as there appears to be nothing wrong with my code. I even ran the code in PyCharm, where it performed the action that I wanted it to do.

So why then have I received this message?

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

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hey Johan,

Your code is correct. :thumbsup:

Now, I have no idea why this is causing the challenge to fail on Task 2, but if you delete those 3 commented lines you have there, both Task one and Task two does pass. Strange!?! :confused:

Maybe send the Support Team and email, and include the URL for this Post. You may earn a special Exterminator Badge for this bug.

Keep Coding! :) :dizzy: