It\'s a very basic doubt in Python in getting user input, does Python takes any input as string and to use it for calculation we have to change it to integer or what? In the fol
a = input("Enter integer 1: ")
b = input("Enter integer 2: ")
c=a+b
d=a-b
p=a*b
print "sum =", c
print "difference = ", d
print "product = ", p
Just use input() and you will get the right results. raw_input take input as String.
And one more i Would Like to Add.. why to use 3 extra variables ?
Just try:
print "Sum =", a + b
print "Difference = ", a - b
print "Product = ", a * b
Don't make the Code complex.