There are several data types in python
This article mainly introduces several data types in python, which can be used for reference. I hope you can learn a lot after reading this article.
1. Numeric Numbers, such as integer int, etc.
In addition, there are long integer long, floating point float, plural complex
2. The string String, the character is also regarded as a string.
Consists of numbers, letters, and underscores, which can be single or double quotation marks
3. List List, an ordered collection of objects.
Each element in the list can be of a different type, identified by "[]", and can be re-assigned, access and modify data according to the following tags, add new elements, and delete elements.
4. Tuple Tuple.
Each element can be of a different type.
Marked with "()", you cannot delete or modify elements or add new elements, but you can delete entire tuples, which is equivalent to a read-only list
5. Dictionary Dictionary, an unordered collection of objects.
Through key access, marked with {}, it is composed of index key and corresponding value value. You only need to add key and corresponding value.
Example
A=31924361222222215478965214d=3.14je=complex (1.2) print (d) print (a) print (e) print (type (a), type (d))
Sample output:
3.14j31924361222222215478965214 (1.2o3j) Thank you for reading this article carefully. I hope the article "several data types in python" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!