runtime errror in python

print(“Enter two Numbers\n”)
a = int(raw_input(‘A=’))
b = int(raw_input(‘B=’))
c=a+b
print (‘C= %s’ %c)
this code is giving runtime error in python …i tried it like 100 times on ideone.com

1 Like

I have checked all the statements individually and they all work fine. I guess the most obvious reason is that you are not giving a proper integer as input to the raw_input() statement or your input string contains some trailing spaces. ex: ‘123’ will run fine while '123 ’ will give run-time error. I would suggest you try raw_input().strip() to remove spaces.

In case this doesn’t solve your problem, possible please give the problem statement and description of input as that is the most likely source of your problems.

P.S. I tested the statements for python 2.7. It might not work in python 3+

//