(n2, n1, operator)
return 0
Calculate operation result

    n2 Number: Number 2
    n1 Number: Number 1
    operator Char: Operation to calculate
Calculate operation result
Calculate operation result
def calc(n2, n1, operator):
    """
    Calculate operation result

    n2 Number: Number 2
    n1 Number: Number 1
    operator Char: Operation to calculate
    """
    if operator == '-':
        return n1 - n2
    elif operator == '+':
        return n1 + n2
    elif operator == '*':
        return n1 * n2
    elif operator == '/':
        return n1 / n2
    elif operator == '^':
        return n1 ** n2
    return 0
def calc ( n2 , n1 , operator ) : if operator == '-' : return n1 - n2 elif operator == '+' : return n1 + n2 elif operator == '*' : return n1 * n2 elif operator == '/' : return n1 / n2 elif operator == '^' : return n1 ** n2 return 0