Q. What is the output of the Python code: x = [1, 2, 3]; print(x * 2)?
Solution:
The * operator with a list and an integer repeats the list, so [1, 2, 3] * 2 becomes [1, 2, 3, 1, 2, 3].
Get Question Bank
Strengthen Your Practice with our comprehensive question bank.