Multiple choice technology programming languages

name=[1]*3

  1. [11]

  2. syntax error

  3. [1,1,1]

  4. runtime error

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Multiplying a list by an integer repeats the list's contents that many times. [1] * 3 creates a new list with three copies of the original element: [1, 1, 1]. This is valid Python syntax and won't cause any errors. The list repetition operator is a convenient way to create lists with repeated elements.