Programming languages deal with data. So, the question which arises over here is how do we actually store this data if we want to reuse it? Let’s you’re working with some data about employees of your organization and you’d have to store the names of employees, so how will you do that?
Well this is where variables come in. Variables are temporary storage spaces to store values.
Let’s say we create a variable called “employee_name”. Then we can go ahead and store the value “John” inside the variable. After some time, i can replace the value with “Sam”. Again after some time i’ll replace it with “Matt”.
Let’s see how can we create variables in python:
var1 = “Sam”
var1 = “Matt”
var1 = “John”
Since, variable is a temporary storage space, we can change the values which are stored in the variable “var1”.