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!
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
Ben Wiley461 Points
I am unclear on the function of del.
If del removes the label and not the element within a list, shouldn't the len() function remain constant, regardless of how many specific items are "del"-ed?
I clearly am having some difficulty understanding the nuances of del.
Steven Parker225,742 Points
The "del" statement does remove an item from a list, reducing the length of the list.
What it does not delete is the object that the list element was referencing. But if there are no other references to the object, it won't be possible to access it again.