I tried to use delete, because in a previous lesson we were taught the following:
" Emptying a list
There are two ways to empty an existing list. The first way is to just assign the list variable to an empty list. In this case, the old list and its contents are automatically deleted by Python. This is shown in the following code example. list1 = [1, 2, 3, 4, 5, 6, 7 ]
list1 = [ ]
The second method is to use the
del() function to delete all the elements of the list. This forces the removal of all the items immediately instead of letting Python delete the contents at some time of its choosing. Both methods produce the same end result which is that the list will be empty of contents.
list2 = [ 10, 20, 30, 40, 50, 60, 70 ]
but obviously that command can’t be right with the space between del and list because python hates spaces. can this even work if put in correct syntax?
lst = del(lst[start:end+1]) ?