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)
0 Comments