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 trial

Python Python Basics (2015) Python Data Types Naming Things

Andrés Leal
Andrés Leal
9,563 Points

When to use "del" ?

When is useful to apply the "del" function in a Python program?

First, 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

Andrés Leal
Andrés Leal
9,563 Points

Shouldn't it be called a function since how it is called or how it was created at first by python! Thanks btw

BTW are you using Python 2 or Python 3? I use Python 3, and in Python 3 del is a keyword.

Andrés Leal
Andrés Leal
9,563 Points

Python 2.7 Should I update to Python 3?

Yes, 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

2 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

According 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.

https://docs.python.org/2/tutorial/datastructures.html

Thx

As a further clarification question, you'd really only use del in the Python shell right? You'd never see it otherwise?

So um I never use it actually