Python Data Structure
This chapter introduces Python's main built-type, including the following:
- Numeric Types int Float
- Text Sequence Type Str
- Boolean BOOL
- Sequence Types List Tuple range
- Mapping Types Dict
- Set Types Set
Type () function
The type (object) function that returns the data type of the object in parentheses.
Number Type
Python provides common numeric types: integer int, floating-point float, complex complex (temporarily not learning, reference document when needed)
1 number = 1 # int2# print (number)3Print (Type (number))4 number = 1.0 # float Note the decimal point is added. 0 is the float type 5 # print(number)6print(type (number))
The numbers can be calculated by operator, which can be mathematically computed by importing the math module. Learn more in the section reference: Python Learning (iii) data structure--int float
Python Learning (iii) data structure