def is_pandigital(x):
    """
    Checks if x contains all digits between 1 and 9 (inclusive) exactly once
    """
    digits = [int(i) for i in str(x)]
    digits.sort()
    return(digits == list(range(1, 10)))