def solve(equation, answer):
    """ Solve equation and check if user is correct or incorrect """

    splitted = equation.split('=')
    left = splitted[0].strip().replace('?', str(answer)).replace('x', '*')
    right = splitted[1].strip().replace('?', str(answer)).replace('x', '*')

    try:
        if right.isdigit():
            return eval(left) == int(right)
        else:
            return int(left) == eval(right)
    except ValueError:
        return False