Ich fange in Python und schrieb nur einen einfachen Rechner, aber es scheint einige errors.Pls mir haben helfenFehler im Rechenprogramm Python
a = raw_input("Enter value of a : ")
b = raw_input("Enter value of b : ")
sum = a + b
sub = a - b
mul = a * b
div = a/b
print"1.Addition"
print"2.Subtraction"
print"3.Multiplication"
print"4.Division"
op = raw_input("Enter the operation to be done : ")
if op == 1:
print"Sum is %d" % sum
elif op == 2:
print"Difference is %d" % sub
elif op == 3:
print"Product is %d" % mul
elif op == 4:
print"Quotient is %d" % div
else:
print"Invalid operation"
Fehler ist Typeerror: Nicht unterstützte Operandtyp für - : 'str' und 'str'
Sie auch schwimmen Sie können(), je nachdem, welche Art von Eingabe Sie erwarten sind – user7091717