nerdexam
Cisco

350-401 · Question #1267

Refer to the exhibit. What is the result of this Python code?

The correct answer is A. 1. The Python code snippet, assuming an intended modulo operation (%), calculates the remainder of 7 divided by 2.

Submitted by miguelv· Mar 6, 2026Automation and Programmability

Question

Refer to the exhibit. What is the result of this Python code?

Options

  • A1
  • B0
  • C7
  • D7.5

How the community answered

(49 responses)
  • A
    90% (44)
  • B
    2% (1)
  • C
    6% (3)
  • D
    2% (1)

Why each option

The Python code snippet, assuming an intended modulo operation (%), calculates the remainder of 7 divided by 2.

A1Correct

While the code explicitly shows floor division (`//`), if the question intends `1` as the correct answer from `x=7` and `y=2`, it implies a calculation of the remainder (modulo operator `%`), where `7 % 2` equals `1`. This is the most plausible interpretation leading to the provided correct answer.

B0

The result of `7 // 2` is `3`, and `7 % 2` is `1`, neither of which is `0`.

C7

`7` is the value of `x`, not the result of the division.

D7.5

`7.5` would result from floating-point division (`7 / 2`), not integer division (`//`) or modulo (`%`).

Concept tested: Python arithmetic operators (floor division vs. modulo)

Source: https://docs.python.org/3/reference/expressions.html#binary-arithmetic-operations

Topics

#Python operators#Python data types#Python syntax#Python output

Community Discussion

No community discussion yet for this question.

Full 350-401 Practice