Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Write six data types in python?
Write six data types in python?
Variables in Python do not need to be declared. Each variable must be assigned before it is used, and the variable will be created only after it is assigned.

There are six standard data types in Python3: number+string+list+tuple+collection+dictionary.

As the name implies, type Number is used to store numerical values. It should be remembered that it tastes a bit like a Java string. If the value of the number data type is changed, the memory space will be reallocated.

You can use the del statement to delete the references of some digital objects Delvar 1 [,Var2 [,Var3 [..., Varn]]]. Python supports three different numeric types:

1. Integer (int)-usually called integer or integer, positive integer or negative integer without decimal point.

Python3 integer has no limit on its size and can be used as a Long type, so Python3 does not have Python2' s Long type.

2.float)- Float consists of integer part and decimal part, and can also be expressed by scientific notation (2.5e2=2.5x 102=250).

3. Complex number ((complex number))-Complex number consists of real part and imaginary part, which can be represented 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. Number type conversion 1.int(x) converts x into an integer.

4.complex(x, y) converts X and Y into complex numbers, where the real part is X and the imaginary part is Y..x and Y are numerical expressions.