What gets printed:
a = b = [1, 2, 3]
b[2] = 4
print(a)
Explanation
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.

I think the answer is 1,4,3.

2022 Jan 17, 5:21:01 PM

I think the answer is 1,4,3.

2022 Jan 17, 5:20:31 PM

Eu acho que a resposta é 1,4,3.

2022 Jan 17, 5:20:25 PM

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Продовжуйте вивчати
тести з Python
Cosmo
Зареєструйся Зараз
або Підпишись на майбутні тести