The numeric data type (c)

Float

float()

n = 211
print(float(n))

Integer and floating-point math, automatically converted to floating point

round (), there are two parameters, a first value is to be calculated, the second decimal places to be reserved

(3.1415926, A = round. 3 )
 Print (A) 

# Results: 3.142

 

Guess you like

Origin www.cnblogs.com/doc-wang/p/11839429.html