import random
from collections import Counter


def get_random_number(range_start, range_end, excluded):
    rand = range_start + random.randint(0, range_end - range_start - len(excluded))
    for ex in excluded:
        if rand < ex:
            break
        rand += 1
    return rand


if __name__ == '__main__':
    results = Counter()
    for _ in xrange(100000):
        results[get_random_number(1, 10, [3, 6, 7])] += 1
    print results
