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 trialScott Larson
2,813 Pointslists del(messy[2]) code won't pass, why?
I've run this code in a python terminal and it works properly. Is something broken in the backend?
messy = [5, 2, 8, 1, 3]
del(messy[2])
1 Answer
Alexander Davison
65,469 PointsFor some reason, the challenge doesn't like you using the parentheses around messy[2]
. I'm 100% sure your code is fine, I think it's just the code challenge is extremely extremely picky.
del messy[2]
I hope this helps
Happy coding!
~Alex
Scott Larson
2,813 PointsHi Alex, Thank you for the feedback.
Best Regards, -Scott
Scott Larson
2,813 PointsScott Larson
2,813 PointsI figured it out. In the simulated python terminal in the challenge you don't use the parens. In the python terminal you can use paren or not, I was using them. I removed them and this worked straight away.
so
del messy[2]
works.