[CODE lang="python" title="del instruction" highlight="5-6"]hatList = [1, 2, 3, 4, 5]
hatList[2] = input(int("Enter an integer number: )")
del hatList[4]
del hatList[-1]
print("Lists content: ", hatList)
[/CODE]
I don't know If I am being stupid but does the del instruction produce a traceback error for line 5 but works for line 6?
hatList[2] = input(int("Enter an integer number: )")
del hatList[4]
del hatList[-1]
print("Lists content: ", hatList)
[/CODE]
I don't know If I am being stupid but does the del instruction produce a traceback error for line 5 but works for line 6?