def ispandigital(n):
    """check if a number is pandigital"""
    s = str(n)
    l = len(s)
    s = s.replace('0', '')  # remove 0
    s = ''.join(sorted(set(s))) # remove duplicates
    if len(s) == l and int(s[-1]) == l:
        return True
    else:
        return False