import ast


def can_eval(s):
    """Returns True if the string can be evaluated."""
    if not s:
        return False
    try:
        ast.parse(s, mode="eval")
    except SyntaxError:
        return False
    else:
        return True