Variables a and b are lists in this example. But they point to the same memory area.
Python list datatype is mutable (meaning that it can be modified in place).
Since both variables point to the same data and it can be modified in place, then after variable b is updated, variable a will change as well.
Войдите чтобы поставить Нравится
Войдите чтобы прокомментировать