I’ve been going through the python exercises for lists and came across this problem. The issue I’m not to understand is why the initial list I’ve given as input for the function gets changed despite no operation being performed on it. Is it because of the way assignment operator work?
Link to the exercise: https://www.codecademy.com/paths/data-science/tracks/dspath-python-lists-and-loops/modules/dspath-lists/lessons/python-functions-lists-cc/exercises/double-index
TIA for the reply.
lst[index] = lst[index] * 2
will update values in the list (you assign a new value to that position in that list), so there are most certainly operations done on the list.