Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Python Basics (2015) Python Data Types Lists

alan ingram
PLUS
alan ingram
Courses Plus Student 3,979 Points

Is it me or the site?

I am doing workspace challenge and I have to remove the "5" from the list, then the next screen has me remove the list from within the list. However, the "5" I just got done removing is still there and now my code crashes because the "5" is still there. I passed one screen and now failing the next, based on a challenge I already completed. Was there something else I was supposed to do? states = [ 'ACTIVE', ['red', 'green', 'blue'], 'CANCELLED', 'FINISHED', 5, ] states.remove(['red', 'green', 'blue'])

5 Answers

alan ingram
PLUS
alan ingram
Courses Plus Student 3,979 Points

I figured it out, I had to make a ink and paper list myself and through process of elimination wrote each option I tried that failed. For some reason I never thought you had to reference the entire list inside the function to delete it. but as soon as I tried, "remove([list items1, list items2, ..])", it deleted. Maybe we can go back to doing computing on stone tablets or paper.

You replaced the code you've written in the previous task, but you aren't supposed to remove the work you did.

Put in your code you wrote in the previous task and it should pass.

james south
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
james south
Front End Web Development Techdegree Graduate 33,258 Points

did you replace the line where you removed the 5, or did you leave it and write a new line below it for task 2? the challenges state that you should leave the code from each task in place when doing subsequent tasks.

alan ingram
PLUS
alan ingram
Courses Plus Student 3,979 Points

I left everything as is. The directions did not indicate that I should make a new line or print anything out. So when you go to the next page, the 5 is still there - eventhough it was correctly removed in the previous screen.

Savanna Sullivan
Savanna Sullivan
924 Points

I defined the list to be removed as a variable, then removed it using states.remove(list) Hope this helps :)