用del操作即可:
import math print(math.pi) del math print(math.pi)
输出:
3.141592653589793 Traceback (most recent call last): File "test.py", line xx, in <module> print(math.pi) NameError: name 'math' is not defined
京公网安备 11010502049817号