In Python, usually expressed with constants in all uppercase variable names:
PI = 3.14159265359
But the fact PI
remains a variable, Python did not have any mechanism to ensure that PI
will not be changed, so, with all uppercase variable name indicates the usage of the constants just a habit, if you must change the variable PI
value, no one can stop you.
In Python, there are two division a division is /
:
>>> 10 / 3
3.3333333333333335
/
Floating-point division calculation result, even exactly divisible by two integers, floating point result is:
>>> 9 / 3
3.0
There is also a division is //
called the floor in addition, two integer division still is an integer:
>>> 10 // 3
3
You read right, integers floor in addition to //
always be an integer, even though indivisible