What will be the output of the following Python code?

ICSE Class 10 Robotics & AI PYQ · 2027 Specimen · Section A

1(xv)1 Mark · 2027 · Section A · 2027 Specimen

What will be the output of the following Python code?

x = 5
print(x + 2)
Show SolutionHide Solution↓

7

Reason — The variable x stores the integer value 5. In the statement print(x + 2), the + operator acts as the arithmetic addition operator because both operands are integers. So the expression is evaluated as 5 + 2 = 7.

← Previous questionNext question →

Browse the free Robotics & AI sample bank