ProgrammingHardProduct-company MCQ pattern

What is printed?

What is printed?
x = 5
print(f"{x=}")
  1. A. 5
  2. B. x=5
  3. C. x = 5
  4. D. 'x'=5

Correct answer: B. x=5

The f-string self-documenting = specifier (Python 3.8+) expands to the literal expression text, an equals sign, and the value's repr, giving 'x=5'.

More Python Programming questions

Exams that ask this topic