New to python as of a few days ago. Trying to write a simple calculator program but when I run it, I get a SyntaxError: unexpected EOF while parsing
error when I input a '+' for choosing my operator. I am stuck on why this is happening and think it may be due to my spaces vs tabs? Can anyone help me?
num1 = int(input('pick number 1: '))
num2 = int(input('pick number 2: '))
choose = str(input('Pick an operator: '))
if (choose == '+'):
print add(num1, num2)
elif (choose == '-'):
print sub(num1, num2)
elif (choose == '*'):
print mult(num1, num2)
else:
print div(num1, num2)
def div(num1, num2):
return num1 / num2
def add(num1, num2):
return num1 + num2
def mult(num1, num2):
return num1 * num2
def sub(num1, num2):
return num1 - num2