पायथन में निम्नलिखित अभिव्यक्ति का मूल्यांकन किस रूप में किया जाएगा?
What will the following expression be evaluated to in Python?
print(15.0 / 4 + (8 + 3.0))
A)
B)
C)
D)
Explanation:
-
Parentheses first:
-
8+3.0=11.0 (since
3.0
is a float, the result is also a float)
-
-
Division operation:
-
15.0/4=3.75 (since
15.0
is a float, floating-point division occurs)
-
-
Addition:
-
3.75+11.0=14.75
-