variables in python and type() method

variables in python and type() method



 var1="hello there" #string type variable

var2=10                 #intege type variable
var3=100.54 #floating point variable
var4=False
print(var1)
print(var2)
print(var3)
print(50*"--")
print("variable var1 type = ",type(var1)) #printing the type of a variable var1
print("variable var2 type = ",type(var2)) #printing the type of a variable var2
print("variable var3 type = ",type(var3)) #printing the type of a variable var3
print("variable var4 type = ",type(var4)) #printing the type of a variable var3
print("type casting variable var3",str(var3))

Comments