Variable Types

Variables are nothing but reserved memory locations to store values. This means that when you create the 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.

 

Multiple Assignment

Python allows you to assign a single value to several variables simultaneously. For example:

This works in the same way with multiple variable assignments for different data types.