nerdexam
Cisco

350-401 · Question #551

Refer to the exhibit. What is the value of the variable list after the code is run?

The correct answer is C. [1, 2, 1, 2, 1, 2]. In Python, multiplying a list by an integer results in a new list that contains the elements of the original list repeated and concatenated consecutively.

Submitted by minji_kr· Mar 6, 2026Automation

Question

Refer to the exhibit. What is the value of the variable list after the code is run?

Options

  • A[1, 2], [1, 2], [1, 2]
  • B[1, 2] * 3
  • C[1, 2, 1, 2, 1, 2]
  • D[3, 6]

How the community answered

(34 responses)
  • A
    15% (5)
  • B
    3% (1)
  • C
    74% (25)
  • D
    9% (3)

Why each option

In Python, multiplying a list by an integer results in a new list that contains the elements of the original list repeated and concatenated consecutively.

A[1, 2], [1, 2], [1, 2]

This syntax represents a tuple of lists or a list containing separate list objects, which is not the behavior of list multiplication; list multiplication creates a single, flattened list.

B[1, 2] * 3

This is the expression itself, not the evaluated result that would be assigned to the `list` variable after the code executes.

C[1, 2, 1, 2, 1, 2]Correct

When a Python list is multiplied by an integer (e.g., `[1, 2] * 3`), the list's elements are repeated that many times and concatenated into a single, flat list, resulting in `[1, 2, 1, 2, 1, 2]`.

D[3, 6]

This would be the result of element-wise multiplication, which is not performed by the `*` operator when multiplying a list by an integer in Python.

Concept tested: Python list multiplication behavior

Source: https://docs.python.org/3/tutorial/introduction.html#lists

Topics

#Python lists#List operations#Sequence repetition

Community Discussion

No community discussion yet for this question.

Full 350-401 Practice