How to define a variable in Python?
In python, each variable must be assigned a value before use. The variable will not be created until the variable is assigned a value
The equal sign (=) is used to assign a value to the variable
=The left side is a variable name
=The right side is the value stored in the variable
Variable name = value
After the variable is defined, it can be used directly later
Example:
1 2 3 4 5 6 7 8 9 10 |
|
Output:
1 2 3 |
|
Related recommendations: "Python Tutorial"
The above is the detailed content of How to define a variable in python. For more information, please follow other related articles on the PHP Chinese website!