# Controleer of de gegeven lijst elk cijfer van 1 tot 9 hoogstens één keer bevat
# Je hoeft niet te controleren of de lijst enkel getallen bevat in het interval [1,9]
def is_correcte_lijst(lijst):
    frequentie = [0] * 10
    for cijfer in lijst:
        frequentie[cijfer] += 1
    for aantal in frequentie:
        if aantal > 1:
            return False
    return True
    
    # Met een while-lus met dubbele conditie:
    # index = 1
    # while index < len(frequentie) and frequentie[index] == 1:
    #    index += 1
    # return index == len(frequentie)


lijst_1 = [3, 4, 8, 5, 2, 1, 6, 7, 9]
print(f"{lijst_1} → {is_correcte_lijst(lijst_1)}")

lijst_2 = [9, 5, 3, 4, 6, 7, 1, 6, 8]
print(f"{lijst_2} → {is_correcte_lijst(lijst_2)}")
