Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to delete a variable python

>>>a = 3.14
>>>a
3.14
>>>del a
Comment

del all variables python

def a_func():
    return 0
a_num = 5
print(dir())
>>> ['__builtins__', '__doc__', ..., 'a_func', 'a_num']
for element in dir():
    if element[0:2] != "__":
        del globals()[element]

del element
print(dir())
>>> ['__builtins__', '__doc__', ...]
Comment

delete variable python

f = 11;
print(f)
del f
print(f)
Comment

python how to delete a variable

del <Object name you want to delete>
Comment

PREVIOUS NEXT
Code Example
Python :: print list in python 
Python :: drop na dataframe 
Python :: staticfiles 
Python :: pdf to csv conversion 
Python :: pandas append csv file 
Python :: change index of dataframe with list 
Python :: python parentheses 
Python :: remove tuple from list python 
Python :: pandas crosstab 
Python :: pygame mirror image 
Python :: how to make a use of list in python to make your own length function 
Python :: python upper 
Python :: how to close a python program 
Python :: python mode 
Python :: pyqt disable maximize button 
Python :: convert matplotlib figure to cv2 image 
Python :: how to remove vowels from a string in python 
Python :: en_core_web_sm 
Python :: gematria python 
Python :: pandas new column average of other columns 
Python :: python list transpose 
Python :: pandas calculate same day 3 months ago dateoffset 
Python :: numpy remove columns containing nan 
Python :: poetry python download windows 
Python :: sort an array python 
Python :: python list of dictionary unique 
Python :: remove all rows with at least one zero pandas 
Python :: convert timestamp to date python 
Python :: python print 2 decimal places 
Python :: pytorch transpose 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =