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

Ikechukwu Arum
Ikechukwu Arum
5,337 Points

lists exercise

not sure what i am doing wrong here. I am supposed to remove the list but it's giving me an error

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

2 Answers

Steven Parker
Steven Parker
231,236 Points

Which task are you on? For task 1, you need to "remove the last item from the list". Then for task 2, you sill need your task 1 code there but you will add more after it.

In all multi-task challenges, each task builds on the work done before. So unless the instructions say otherwise, anything you write for a task will remain as-is as you continue to add to it for the other tasks.

Hi Ikechukwu,

The first exercise wants you to remove the last list item and the second exercise wants you to remove the second list item.

Are you on the second exercise? You'll have to remove the 5 first and then your code will work

Cheers!