Learn Python Variable Types
Apples = input("Enter the Value of Apples: ")
Oranges = input("Enter the Value of Oranges: ")
print (Apples)
print (Oranges)
#print (Apples + Oranges)
print ("Before typecasting, type of Apples is ", type(Apples))
print ("Before typecasting, type of Oranges is ", type(Oranges))
Apples = int(Apples) #casting from string to integer
Oranges = int(Oranges) #casting from string to integer
print ("After typecasting, type of Apples is ", type(Apples))
print ("After typecasting, type of Oranges is ", type(Oranges))
print (Apples)
print (Oranges)
print ("Total fruits, result is ", Apples + Oranges)
On this page of the site you can watch the video online Learn Python Programming 7 - Variable Types and Type Casting (with Examples) with a duration of hours minute second in good quality, which was uploaded by the user TNTeach #NCERT #CBSE #Python 23 August 2019, share the link with friends and acquaintances, this video has already been watched 112 times on youtube and it was liked by 11 viewers. Enjoy your viewing!