Test Index

Python Revision Tour Get it on Google PlayDownload on the App Store CBSE Board Videos

© examsnet.com
Question : 55 of 102
Marks: +1, -0
What will be the output of the following statement :
print (16*5/4*2/5-8)
[CBSE 2024 Set 4]
Solution:  
Concept:
* and / have the same precedence and are evaluated left to right; - is done last. The operator / always gives a float.
Solution:
16*5 = 80
80/4 = 20.0
20.0*2 = 40.0
40.0/5 = 8.0
8.0-8 = 0.0
Key point: The result is printed as 0.0 (a float), because / gives a float even when the division is exact.
Answer:
Option C (0.0)
© examsnet.com
Advertisements
Go to Question: