Is delete just filler? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Is delete just filler?

Why waste an extra line with del when you could just erase the original line?

27th Aug 2016, 1:16 AM
Dylan Restivo
Dylan Restivo - avatar
2 Answers
+ 1
There may come a time where you dont need to use the variable any more and deleting it saves memory (RAM). On larger scale projects this would improve the performance of it.
30th Aug 2016, 7:25 AM
James Tompkins
James Tompkins - avatar
+ 1
while a program runs, you will not be able to actively modify the source code. use del when you need a variable for a certain task, and del it when you're done, if you so choose.
22nd Oct 2016, 7:37 PM
Alex Schrichte
Alex Schrichte - avatar