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

why dont we have brackets inside parentheses?

why dont we have brackets inside parentheses?

and also the code is really messy.

is the last item the integer 5 even a item from the list? it looks like it does not belong there what i mean is that all other items have brackets inside parentheses except from the last 3 items, and why is that

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

1 Answer

Steven Parker
Steven Parker
229,784 Points

You're right, there are things in that list that don't belong there, and the whole point of the challenge is for you to use program statements to remove the unwanted items.

But I'm not sure why you were expecting "brackets inside parentheses". The brackets themselves are all you need to identify a list.