Python supports three different number types: int, float and complex.
In other programming languages, such as Java and C, there are also long types and short types. Python, on the other hand, has only int types, but no long and short types.
Related recommendation: Python tutorial
Integer:
It is usually called an integer, which is an integer or a negative number without a decimal point. Python3 integer types have no size limit. Integer: 0, 10 -780, -089, -0x270, 0x90.
Floating-point type:
A floating-point type consists of an integer part and a decimal part. Floating point numbers: 0.0, 15.2, -2.9,--32.5e 10/0,32+e18.
Floating-point numbers can be expressed by scientific calculation: 2.5e2 = 2.5x 10 2 = 250.
Complex type:
Complex number consists of real part and imaginary part, which can be expressed by a+bj or complex number (a, b). The real part A and imaginary part B of a complex number are both floating-point types. Complex: 3. 14j, 9.23e-35j, 4.53e-7j.
Python number type conversion
Int(x) converts x into an integer.
Float(x) converts x into a floating point number.
Complex(x) converts x into a complex number, with the real part being x and the imaginary part being 0. Complex(x, y) converts x and y into complex numbers, where the real part is x, the imaginary part is y, and x and y are numerical expressions.
1, I hope you don't need a specific holiday; You can be calm and happy every day.
2. May all vulgar greetings take effect on you.
M