variable and type casting in python

technical talkiess
0

 print("Variable and type casting in the python")

var1= "23" 

#string variable

var2 = 35 # int variable 

var4 = 20.36 #float variable 


#If you want to check the datatype of the varable you can use the type function in the python


print(type(var1))


#type casting in the python .... 

castinginpython =int(var1)

print(castinginpython) 

# it's convert the string to int value 


#excercise 

print("\n")

print("Please enter the first number :- ")

n1 = int(input())

print("Please enter the second number :- ")

n2 = int(input())

print("The addition of the 2 number is :-  ", n1+n2)

Post a Comment

0Comments

Thanks you for commenting your questions. I will see question and respond you.

Post a Comment (0)