filmov
tv
#5 Learn to use Python variables and strings

Показать описание
In every Python program you write, you will have variables, which are memory locations to store values. This means that when you create a variable you reserve some space in memory.
Based on the data type of a variable, the interpreter allocates memory and decides what can be stored in the reserved memory. Therefore, by assigning different data types to variables, you can store integers, decimals or characters in these variables.
In Python, variables don't need explicit declaration, declaration happens automatically when you assign a value to a variable. The operand to the left of the = operator is the name of the variable and the operand to the right of the = operator is the value stored in the variable.
Based on the data type of a variable, the interpreter allocates memory and decides what can be stored in the reserved memory. Therefore, by assigning different data types to variables, you can store integers, decimals or characters in these variables.
In Python, variables don't need explicit declaration, declaration happens automatically when you assign a value to a variable. The operand to the left of the = operator is the name of the variable and the operand to the right of the = operator is the value stored in the variable.