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 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!