Numbers-> Int class (recommended: Python video tutorial)
Of course, for numbers, Python's number types are int integer, long integer, float floating point number, complex number and Boolean value (0 and 1). Only int integers are introduced and studied here.
In Python2, the size of integer is limited, that is, when the number exceeds a certain range, it is no longer an int type, but a long integer. In Python3, no matter the size or length of an integer, it is called integer int.
Boolean value-> boolean class
For Boolean values, there are only two results, namely true and false, which correspond to binary 0 and 1 respectively. There are too many values of True and true. We just need to know what the values of Flase and true are-"none, empty (that is, []/()/{}), 0;
String-> string class
String is the most commonly used data type in Python, and it has many uses. We can use single quotation marks'' or double quotation marks'' to create strings.
The string cannot be modified. We can introduce all the characters from the aspects of index, slice, length, traversal, deletion, segmentation, blank space, case conversion, and judging where to start.
List-> list class
A list consists of a series of elements, with specific elements arranged in order. Its elements can be any data type, that is, numbers, strings, lists, tuples, dictionaries, Boolean values, etc. , and its elements can also be modified.
Tuple-> tuple class
A tuple is a list that cannot be modified. Its characteristics are similar to list. They are identified by parentheses instead of square brackets.
Dictionary-> dictionary class
A dictionary is a series of key-value pairs. Each key-value pair is separated by a comma, and each key corresponds to a value. You can use the key to access the corresponding value. Disorder.
The definition of a key must be immutable, that is, it can be a number, a string, a tuple, a Boolean value, etc.
Settings-> Set category
Definition of a set: In my opinion, a set is like a basket. You can put things in it or take things from it, but these things are out of order, so it is difficult for you to specify to take one thing alone. At the same time, you can filter through certain methods to get what you need. Therefore, collections can be created, added, deleted and related operations.
Features of this kit:
1, deduplication
2. Chaos
3. Each element must be an immutable type (hashable type, which can be used as the key of dictionary).
For more Python-related technical articles, please visit the Python tutorial section to learn!