How to delete a lists in Python

1 Answer

0 votes
lst = ["python", "c", "c++"]

print(lst)

del lst

print(lst)




'''
run:

['python', 'c', 'c++']

Traceback (most recent call last):
  File "test.py", line 7, in <module>
    print(lst)
NameError: name 'lst' is not defined

'''

 



answered Apr 29, 2021 by avibootz
...