Topics

Wednesday, 26 June 2019

Example program on float data type

Example program on Float:

m=20
p=40
c=76
tot=m+p+c
avg=tot/3
print(avg)
45.333333333333336
print("%.2f"%avg)
45.33
print("%.2f" % round(avg,2))
45.33

You may like the following posts:


No comments:

Post a Comment