belongs to collection: Python Input and Output Exercises
print()
Given:
num = 458.541315
Expected Output:
458.54
Hint:
Use the %.2f formatting code in print() function to format float number to two decimal places.
%.2f
Solution:
num = 458.541315 print('%.2f' % num)
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Hint:
Use the
%.2f
formatting code inprint()
function to format float number to two decimal places.Solution:
need an explanation for this answer? contact us directly to get an explanation for this answer