Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python undefine variable

# Basic syntax:
del variable

# Example usage:
variable = 42
print(variable)
--> 42
del variable
print(variable)
--> NameError: name 'variable' is not defined
# Note, this error is what we expect now that the variable has been deleted
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #undefine #variable
ADD COMMENT
Topic
Name
4+3 =