$ ./guess_the_languageProblem Solving — predict the output
Problem Solving — predict the output · hard · #45

What is printed?

print([1, 2, 3] * 2)
  1. [2, 4, 6]
  2. [1, 2, 3, 2]
  3. [[1,2,3],[1,2,3]]
  4. [1, 2, 3, 1, 2, 3]
List multiplication repeats the elements, not doubles them.
Play Problem Solving ▸