Use the "=" symbol to define a variable in python. The left side of the "=" symbol is the variable name, and the right side of the "=" symbol is the value of the variable. Python supports assigning values to multiple variables at the same time. Specifying different values for multiple variables is also supported.
#What are variables?
Variable: A quantity whose value will change, as opposed to a constant
Variable data types supported by python:
1. Number
2, string
3, list
4, tuple
5. Dictionary
Variable naming convention: variable names are all lowercase words, and each word is connected with _underscores to make it as clear as possible Name Zhiyi
The format of declaring variables: variable name = value (the type of value determines the type of variable) For example:
Assignment of multiple variables: Python supports assigning values to multiple variables at the same time, as follows
Specifies different values for multiple variables:
The above is the detailed content of How to define variables in python. For more information, please follow other related articles on the PHP Chinese website!