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 trialpikapika123
440 Pointserror
where am i making a mistake
messy = [5, 2, 8, 1, 3]
delete=list('52813')
del delete[2]
1 Answer
Jennifer Nordell
Treehouse TeacherHi there! You've created a new variable named delete
which is not required for this challenge. To use the del
function we need to supply the index of the item we want to delete. In this case, 5 has an index of 0, 2 has an index of 1, and 8 has an index of 2. So this is the line needed:
del messy[2]
This will delete the item at index 2 of the messy
list.
Hope this helps!