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.

Andrés Leal
9,563 PointsWhen to use "del" ?
When is useful to apply the "del" function in a Python program?

Andrés Leal
9,563 PointsShouldn't it be called a function since how it is called or how it was created at first by python! Thanks btw

Alexander Davison
65,456 PointsBTW are you using Python 2 or Python 3? I use Python 3, and in Python 3 del is a keyword.

Andrés Leal
9,563 PointsPython 2.7 Should I update to Python 3?

Alexander Davison
65,456 PointsYes, you should update it. Kenneth Love (the Python teacher) is teaching in Python 3, so please install it. You can install it at www.python.org. Kenneth Love also will teach you how to install it!
Hope it helps! ~xela888

Moe Myint Kyal Sin
Courses Plus Student 553 PointsWhen you want to delete your variable.
2 Answers

Jennifer Nordell
Treehouse TeacherAccording to the Python documentation del is not a function but rather a statement built-in to Python to handle data structures. You can find more information here.

Alexander Davison
65,456 PointsThx

A X
12,842 PointsAs a further clarification question, you'd really only use del in the Python shell right? You'd never see it otherwise?

Alexander Davison
65,456 PointsSo um I never use it actually
Alexander Davison
65,456 PointsAlexander Davison
65,456 PointsFirst, it isn't a function, it is a keyword (just so you know). I never ever use del, but you might just encounter it in other peoples' programs.
Hope it helps! ~xela888