def hasPrecedence(operator1, operator2):
    """Checks if operator2 has precedence over operator1

    Args:
        operator1 (str): first operator
        operator2 (str): second operator

    Returns:
        (bool): true if operator2 has precedence over operator1 else false
    """
    if operator2 == '(' or operator2 == ')':
        return False
    elif (operator1 == '*' or operator1 == '/') and (operator2 == '+' or operator2 == '-'):
        return False
    else:
        return True