As in java
int requires 4 bytes
float requires 4 bytes
char requires 2 bytes
but in python we donot declare type of variable so,
Q. When memory is allocated to the variable?
As in the below example different type of data is allocated to same variable
var = 10
print var
print type(var) #<type 'int'>
var = 10.5
print var
print type(var) #<type 'float'>
var = "python"
print var
print type(var) #<type 'str'>