def is_self_describe(line):
    """Check if number is self describing, return 1 if so, 0 if not."""
    num_str = line.rstrip()

    if len(num_str) <= 10:
        numlist = list(num_str)
        for x in range(len(numlist)):  # pylint: disable=invalid-name
            if int(numlist[x]) == numlist.count(str(x)):
                continue
            else:
                return 0
        return 1
    return 0