What will be the value of the following Python expression?
4 + 3 % 5
4 + 3 % 5
A. 7
B. 2
C. 4
D. 1
Answer: Option A
Solution (By Examveda Team)
The expression 4 + 3 % 5 evaluates to 7 in Python.Here's the breakdown:
#1. 3 % 5 calculates the remainder when 3 is divided by 5, which is 3.
#2. 4 + 3 then adds 4 to the result of the modulo operation, resulting in 7.
Therefore, the value of the expression is 7.
Join The Discussion