nerdexam
Cisco

350-401 · Question #944

What is displayed when the code is run?

The correct answer is C. The answer is 25. The Python code performs an arithmetic calculation and then embeds the result into an f-string for printing.

Submitted by kevin_r· Mar 6, 2026

Question

What is displayed when the code is run?

Exhibits

350-401 question #944 exhibit 1
350-401 question #944 exhibit 2

Options

  • AThe answer is 100
  • BThe answer is 5
  • CThe answer is 25
  • DThe answer is 70

How the community answered

(60 responses)
  • A
    15% (9)
  • B
    7% (4)
  • C
    75% (45)
  • D
    3% (2)

Why each option

The Python code performs an arithmetic calculation and then embeds the result into an f-string for printing.

AThe answer is 100

The calculation `x * y / 2` is `5 * 10 / 2 = 25`, not 100.

BThe answer is 5

The calculation `x * y / 2` is `5 * 10 / 2 = 25`, not 5.

CThe answer is 25Correct

The expression `x * y / 2` evaluates to `5 * 10 / 2`, which is `50 / 2 = 25.0`. The f-string then formats this result as 'The answer is 25.0', which is typically represented as 'The answer is 25' in contexts where the decimal zero is omitted.

DThe answer is 70

The calculation `x * y / 2` is `5 * 10 / 2 = 25`, not 70.

Concept tested: Python f-strings and arithmetic operations

Source: https://docs.python.org/3/tutorial/inputoutput.html#formatted-string-literals

Topics

#code execution#output prediction#scripting logic#automation scripting

Community Discussion

No community discussion yet for this question.

Full 350-401 Practice