Sail E0 Webinar
Question
What is the result of the expression shown below if x=56.236?print("%.2f"%x)
Options:
A .  56.00
B .  56.24
C .  56.23
D .  0056.236
Answer: Option B


The expression shown above rounds off the given number to the number of decimal places specified. Since the expression given specifies rounding off to two decimal places, the output of this expression will be 56.24. Had the value been x=56.234 (last digit being any number
less than 5), the output would have been 56.23.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers