0
How do i round off a float value to two decimal place.
I was wondering how to round off decimal places in python. As some question i need this to be concept clear
2 Respuestas
+ 2
you need to call the round () function. for example:let us say we have a variable name a, which has an output :
12.3469
if we want to round off to two decimal places, we say:
a (round,2)
we should get 12.35
+ 2
just use format specifiers see below code
print("%.2f" %(12.3469))