By the way all the solution above does not work. You can't declare arguments call for function that is going to get user input. Because to call that function you have to pass argument for it so it doesn't throw error.

Secondly, if you need a string input you call raw_input function. If you need integer number, you call the input function. This is the working code of that calculator and I wrote it as easiest to read as possible. Have fun and good luck If you need programming help, look for my articles. I write for people that just learning to the very expert one. It take me a week to go through one subject but if you read my article you can find out which programming language which suit you.

Here is the working program. With one loop of built in error check to show you how it is done.

def calculator():
operation = raw_input("a = Add, s = Subtract, m = Multiply, d = Divide:")
while (operation is not "a" and operation is not "s" and operation is not "m" and operation is not "d" and operation is not "q"):
print("Incorrect input, please try again. Type q to quit" )
operation = raw_input("a = Add, s = Subtract, m = Multiply, d = Divide:")
if operation is "q":
return;
if operation is "a":
x = input("First number:")
y = input("Second number:")
other = raw_input("Any other numbers?")
if other == "y":
z = input("Please input your next number:")
return x + y + z
else:
return x + y
if operation is "s":
x = input("First number:")
y = input("Second number:")
return x - y
if operation == "m":
x = input("First number:")
y = input("Second number:")
return x * y
if operation is "d":
x = input("First number:")
y = input("Second number:")
return x / y
a = calculator()
print(a)