name_list = ['tom', 'yi']
#del list_name:删除列表
del name_list
print(name_list)
运行结果:
Traceback (most recent call last):
File "E:/python/Pycharm/code/test/list_delete.py", line 4, in <module>
print(name_list)NameError: name 'name_list' is not defined#name_list已经被删除