📜  python undefine 变量 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:13.135000             🧑  作者: Mango

代码示例1
# 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