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

Bad error being reported

Challenge Task 2 of 2

OK, one more removal. See that second item in states? It's a list of colors and doesn't belong here. Can you get rid of it for me? Be sure to use .remove() again. Oops! It looks like Task 1 is no longer passing. Get Help Recheck work Go to task One lists.py

abcd) 1 states = [ 2 'ACTIVE', 3 ['red', 'green', 'blue'], 4 'CANCELLED', 5 'FINISHED', 6 5, 7 ] 8 abcd = states[1]

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

1 Answer

AJ Salmon
AJ Salmon
5,675 Points

In code challenges, make sure you're adding your additional code to the code you wrote in the previous task (unless it explicitly says not to.) So what you have is correct, and will remove the item with the index of one from the list. Just leave the line where you remove 5 from the list as well!