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

James Ward
James Ward
1,787 Points

Task 1 no longer passing

I'm confused with this task, I have tried the following and neither work;

I think the issue relates to the 2 separate code blocks (the first part is task 1) , Ive tried adding the 2 together for task 2, but it borks.

states.remove (5)

states.remove (['red', 'green', 'blue'])

states.remove (5,['red', 'green', 'blue'])

Help Plz

lists.py
states = [
    'ACTIVE',
    ['red', 'green', 'blue'],
    'CANCELLED',
    'FINISHED',
    5,
]
states.remove (5)
states.remove (['red', 'green', 'blue'])
David Gabriel
seal-mask
.a{fill-rule:evenodd;}techdegree
David Gabriel
Python Web Development Techdegree Student 979 Points

Hi James you have space between remove and 5 it should be states.remove(5) and the second list ['ACTIVE', 'CANCELLED', 'FINISHED'] make sure all in capital i hope that will help

3 Answers

David Gabriel
seal-mask
.a{fill-rule:evenodd;}techdegree
David Gabriel
Python Web Development Techdegree Student 979 Points

Hi Jeff, i need your help with the list below st = [1, 2, 3, 4, 5] colors_list = ["Red", "Yellow", "Green", "Black", "White"]

James Ward
James Ward
1,787 Points

Hi David, Perhaps try without the spaces like my answer below?

James Ward
James Ward
1,787 Points

Hi All, I figured out my mistake, I had a space between states.remove and the parameter , once removed it worked.

James Ward
James Ward
1,787 Points

You are welcome Daniel