import random def chooseNeighbours(count: int, i: int) -> set: neigh = set() while len(neigh) < count: num = random.randint(0,7) if num != i: neigh.add(num) return neigh