python version
Python's current version is divided into 2.7 and 3.5, and the two versions of the code are currently incompatible, looking at the Python version number:
Python--version
Basic data TypesNumber Type
The use of integral and floating-point data is basically consistent with other programming languages:
x = 3Print(Type (x))Print(x)Print(x + 1)Print(x-1)Print(X * 2)Print(x * * 2) x+ = 1Print(x) x*=2Print(x) y= 2.5Print(Type (y))Print(Y,y + 1,y * 2,y * * 2) M= 5N= 3Print(5/3)#precise division, preserving the decimal partPrint(5//3)#take only the integer part of the division resultPrint(5% 3)#two integers to divide the remainder ofPrint(Divmod (M,n))#back (x//y, x%y)Print(Pow (m,n))#Power Calculationa=-3Print(ABS (a))#Absolute Value CalculationPrint(-a)#Take counterPrint(+a) C= 2-3j#pluralPrint(Type (c))Print(c.real)#Real DepartmentPrint(C.IMAG)#Imaginary Part
Results:
<class'int'>3426948<class'float' >2.5 3.5 5.0 6.251.666666666666666712(1, 2)12533-3<class' Complex '>2.0-3.0
Note that unlike other languages, there is no self-adding, self-subtraction operation in Python, that is, there is no following operation:
i++I--
Python Quick Start Tutorial