def is_valid_deck(deck):
    """(list of int) -> bool

    A valid deck contains all ints from 1 to the highest value of the deck.
    This function returns wheter the supplied deck is valid.

    >>>is_valid_deck([1, 2, 3, 5, 7, 6, 4, 9])
    False

    >>>is_valid_deck([1, 2, 3, 5, 7, 6, 4, 8])
    True

    """
    if deck == []: # An empty list cannot be valid
        return False

    else:
        i = 1 # The first entry in the deck will always be one


        while i <= max(deck):
        # Starting at the first entry, go through each succeding
        # int up the last and make sure it is contained in the deck
            if not i in deck:
            # If this if statement is never true the function returns True
                return False
            i += 1 # Iterates through each int up the max of the deck

        return True