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 trialALEJANDRO ALANIS
327 PointsPython Basics challenge Task 1 of 2. I need to use 'del' on my code and I am, but I get an error saying I didn't used it
Python Basics challenge Task 1 of 2. I need to use 'del' on my code and I am, but I get an error saying I didn't used it. I think I'm right, but I need help if I'm doing it worng. Thanks!
messy = [5, 2, 8, 1, 3]
messy_list = list(messy)
del messy_list[2]
2 Answers
K Cleveland
21,839 PointsThe challenge asks you to: "Use del to delete the 8 from messy."
Your code reads like this:
messy = [5, 2, 8, 1, 3]
messy_list = list(messy)
del messy_list[2]
The challenge asks you to delete 8 from messy, not messy_list. Hope this helps!
ALEJANDRO ALANIS
327 PointsI thought I needed to turn it into a list... oh my. But yeah it did worked, haha, thanks!
K Cleveland
21,839 PointsGlad it worked out!