This is an introductory knowledge, I recorded.
In Python, by default, if the expression is full of integers, the result will be just an integral type. Sometimes you don't notice unexpected results, such as:
>>> a = 7>>> b = 3>>> c = a/b>>> Print C2
Sometimes it can cause a certain error, so when you need to get the result of floating-point precision, you must have a floating-point type in the expression.
If it is a constant, it can be solved by adding.
>>> Print 7.0/32.33333333333
If all variables are variable, you can use the Float function to convert, or *1.0, such as
>>> a = 7>>> B = 3>>> print float (a)/b2.33333333333>>> print a*1.0/b2.33333333333
But remember to start the conversion at the first place, or else there will be problems, such as
>>> a=7>>> b=3>>> c=2>>> print a/b*float (c) 4.0>>> print float (a)/b* c4.66666666667
Make Python integer evaluates to floating-point