We know that lists in Python are mutable objects. However, the following code does not change the value of the list whose value is being modified inside a function.
def change(l):
l=l[2:5]
return()
l=[1,3,4,5,2,10]
change(l)
print (l)
I expected an output [4,5,2] but it's showing the results [1,3,4,5,2,10].