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