In a Python program, each data is an object, and each object has its own type. Different types have different operation methods. Using the unique operation methods of built-in data types, you can complete a lot of work faster.
Some basic data types in Python, such as integers (numbers), strings, tuples, lists, dictionaries and Boolean types. As the learning progress deepens, everyone will come into contact with more and more interesting data types. Beginners of Python can just understand these types first when getting started.
Corresponding symbols of python's basic built-in data types
1. Integer type - int - number
Python has 5 number types, the most common one is integer Type int, the int python method is very practical. For example: 1234, -1234
2. The Boolean type - bool - is represented by the symbol ==
The Boolean type is a special python number type. It only has True and False has two values, which are mainly used for comparison and judgment. The result is called a Boolean value.
For example:
3==3 gives True, 3==5 gives False3) String - str - represented by ' ' or " "
For example:
'www.iplaypy.com' or "hello" 4) List - list - represented by 5) Tuple - tuple - represented by ( ) symbol
For example:
('d',300) 6) Dictionary - dict - represented by { } symbol
For example:
{' name':'coco','country':'china'} Which of the Python basic data types are mutable and which are immutable
Python variable data types: list list[ ], dictionary dict{ }
Python immutable data types: int, string str' ', tuple tuple()