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

I used del messy[2] then del messy [1] to delete the even numbers but it still says I'm not correct. What is missing?

Can someone help with this?

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

3 Answers

Tushar Singh
Tushar Singh
Courses Plus Student 8,692 Points

It's working for me, may be You did something wrong.sometimes we make silly mistakes(just re-check)

messy = [5, 2, 8, 1, 3]
del messy[2]
del messy[1]
gaetano amoroso
gaetano amoroso
2,993 Points

really if you delete first messi[2] and then messi [1 ] it works fine but maybe the challenge is other

Please if you want post the text of the challenge maybe I can help you

I just realised what the issue was... I should have removed the space between messy and [2]. When I write del messy[2] instead of del messy [2] (with a space) it works. Thanks!