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

Peter Ndungu
Peter Ndungu
1,395 Points

del

Hello, how comes even after writing the right code am getting the message "Oops! it looks like Task 1 is no longer passing". Here is the code for deleting the number 2 from messy. someone advice.

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

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

Hi Peter, the Challenges always expect you to retain what is given and what you do as-is when moving on to the next task in the challenge. Keep 'messy' as it was, put the first "del messy[2]" below it and check answer. Then type "del messy[1]" in the third line. Don't change the value of the 'messy' in the first line, or comment it out, just add your code one below the other. Hope this helps.

Peter Ndungu
Peter Ndungu
1,395 Points

Thanks Sashi and uday. It works now.

1 Answer

uday kiran
uday kiran
3,222 Points

its because task 1 is missing

messy = [5, 2, 1, 3]

write your task 1 here

del messy[1]