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 cleanup

Alexandre Gagarochkine
Alexandre Gagarochkine
426 Points

And, finally, we need to remove that 2. Can you delete it with del, too?

messy = [5, 2, 8, 1, 3] del messy[1]

Plase axplane why not work?or i did mistake. thanks

lists.py
messy = [5, 2, 8, 1, 3]
del messy[1]

2 Answers

Steven Parker
Steven Parker
231,236 Points

In multi-task challenges, you add to the previous code in each step.

It looks like you removed the task 1 code when doing task 2. You need to leave the code you did for task 1, and add code to perform the task 2 instructions to it.

The "Check Work" function will always re-test each previous task in order, so if previous code is removed or altered it will keep you from passing.

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hi there,

It looks like you deleted the code from Task One? All code that you enter needs to be there as the Tasks move on. So, the code above is correct, but the Code Checker will return an error because it's still trying to find the code from the first task.

Hope that helps. :dizzy: