☞Named labels, whose values can be used and processed during program execution is known as variable.
☞When you run any program, it consumes memory in RAM till its execution in the process.
☞Examples : X = 5; _Y=3.5
☞It consumes memory dynamically and hence it is dynamically typed language (Not only the value of a variable may change during program execution but the type as well)
☞Value of a variable is stored at some location and that location will have address.
☞To find the address of the value of a variable : use id() function
☞To find the type of a variable : Use type() function
☞ Example :
x=3 print(type(x)) print(id(x))
<class ‘int’> # type of variable x 1467205584 # address of variable x
☞ Concept of a variable
Example :
x=10 print(id(x)) y=10 print(id(y)) y=5 print(id(x)) print(id(y))
1472120896 #address of x 1472120896 #address of y 1472120896 #address of x 1472120816 #address of y
☞Object is capable to store a set of values and can invoke a set of operations.
☞Every variable in Python is an object.