Simple calculator (going H.A.M with defining functions) I am toying around and playing a lot with defining a function. I'm trying to get extremely comfortable with it. The code I have wrote works fairly well, but definitely is not perfect. Also, the function I made called playagain is having some errors. When I type in "Yes" for the input I'm getting a strange TypeError. If you can fix that, please explain to me how, in the simplest way possible.

import sys

OPTIONS = ["Divide", "divide", "Multiply", "multiply", "Add", "add", "Subtract", "subtract"]

def userinput():
    while True:
        try:
            number = int(input("Number: "))
            break
        except ValueError:
            print("NOPE...")
    return number

def operation():
    while True:
        operation = input("Multiply/Divide/Add: ")
        if operation in OPTIONS:
            break
        else:
            print("Not an option.")
    return operation

def playagain():
    while True:
        again = input("Again? Yes/No: ")
        if again == "Yes" or again == "yes":
            break
        elif again == "No" or again == "no":
            sys.exit(0)
        else:
            print("Nope..")

def multiply(x,y):
    z = x * y
    print(z)

def divide(x,y):
    z = x / y
    print(z)

def add(x,y):
    z = x + y
    print(z)

def subtract(x,y):
    z = x - y
    print(z)

while True:
    operation = operation()
    x = userinput()
    y = userinput()
    if operation == "add" or operation == "Add":
        add(x,y)
    elif operation == "divide" or operation == "Divide":
        divide(x,y)
    elif operation == "multiply" or operation == "Multiply":
        multiply(x,y)
    elif operation == "subtract" or operation == "Subtract":
        subtract(x,y)

    playagain()


I tried defining as much functions as possible to make it simpler and easier to fix and debug. Please let me know what you think. 

NOTE: I am not making this program to actually be a beneficial program. I am simply using it to help myself with the defining a function portion of Python.
Of the feedback on your earlier version of this programme, the most obvious thing that you haven't done yet is to use lower() on text inputs so that you only have to compare against lower case options. e.g.

    again = input("Again? Yes/No: ").lower()
    if again == "yes":
        break
    elif again == "no":
        sys.exit(0)


It might be useful to know that the operations you define already exist as methods of numeric variables in Python, called __mul__, __add__, etc., and are also available within the operator module. e.g. operator.add(3, 4) is equivalent to 3 + 4. So you could, for example, do this

import operator

OPTIONS = {
    'divide': operator.truediv,
    'multiply': operator.mul,
    'add': operator.add,
    'subtract': operator.sub
}

def user_input():
    while True:
        try:
            return int(input("Number: "))
        except ValueError:
            print("NOPE...")

def get_operation():
    while True:
        operation = input("Multiply/Divide/Add/Subtract: ").lower()
        try:
            return OPTIONS[operation]
        except KeyError:
            print("Not an option.")

def play_again():
    while True:
        again = input("Again? Yes/No: ").lower()
        if again == "yes":
            return True
        elif again == "no":
            return False
        else:
            print("Nope..")

while True:
    operation = get_operation()
    x = user_input()
    y = user_input()
    print(operation(x, y))
    if not play_again():
        break