Number types and operations in basic Python syntax1, integer type ① integer type and the concept of integer in mathematics ②4 kinds of base representation!③ Generally speaking, the integer type has no limit on the value range.

Floating-point number type ① Is consistent with the concept of real numbers in mathematics. It represents a value with a fractional part. Python specifies that floating point numbers must have a fractional part, which can be 0. ② The numerical range and decimal accuracy of floating point numbers are limited by different computer systems. ③ Scientific counting method: specify E or E as the symbol of the power, with 10 as the base.e= a×b∧10 3, numerical operation

abs (x)     The absolute value of x
<<< print(abs(-1))
1
Copy the code
divmod(x, y)   #(x//y), the output is binary
<<<print(divmod(10.3)
(3.1)
Copy the code
pow(x,y[.z])   # (x**y) %z,[,] pow (x**y)
<<<print(pow(2.3))
8
Copy the code
round(x,[.ndigits])   # Round x, keep ndigits decimal
<<<print(round(3.1456.3))
3.146
Copy the code
max(x1, x2...... xn)# x1, x2... The maximum value of xn, n is unlimited
<<<print(max(1.2.3.4.5 6.7.8.9))
9
Copy the code
min(x1, x2...... xn)# x1, x2... Minimum value of xn, n is unlimited
<<<print(min(1.2.3.4.5 6.7.8.9))
1
Copy the code
float(x)   Print x as a floating-point number. X can be an integer or a string
<<<print(float(3))
3.0
Copy the code
int(x)   Print x as an integer. X can be a floating point number or a string
<<<print(int(3.5))
3
Copy the code
complex(re[,im])   Create a complex number with re as the real root and im as the imaginary part. Re can be an integer, float, or string. Im can be an integer, float, or string
<<<print(complex(5.12(a))5+12j)
Copy the code

Thanks for reading my blog My is a Self-taught Python boy😃😃😃