Q. What does the Python code: x = [1, 2, 3]; y = x; y[0] = 10; print(x) output?
Solution:
Since y is an alias for x (same object), modifying y[0] also changes x[0], resulting in [10, 2, 3].
Get Question Bank
Strengthen Your Practice with our comprehensive question bank.