Home  >  Article  >  Backend Development  >  What are the basic data types in python

What are the basic data types in python

藏色散人
藏色散人Original
2019-06-25 10:24:243593browse

What are the basic data types in python

What are the basic data types in python?

Python basic data types are generally divided into six basic data types: numbers, strings, lists, tuples, dictionaries, and sets.

Numbers include integers (integers include standard integers and long integers (available in Python 2.7 and earlier versions)), floating point types, complex number types, and Boolean types (Boolean types are only two an integer type of value), these numeric types. Lists, tuples, and strings are all sequences.

Note:

Variables in Python do not need to be declared. Each variable must be assigned a value before use. The variable will not be created until the variable is assigned a value.

In Python, a variable is a variable, it has no type. What we call "type" is the type of the object in memory pointed by the variable.

The equal sign (=) is used to assign values ​​to variables.

The left side of the equal sign (=) operator is a variable name, and the right side of the equal sign (=) operator is the value stored in the variable.

Related recommendations: "Python Tutorial"

The above is the detailed content of What are the basic data types in python. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn