generating all pairs suppose I have 6$\{0,1,2,3,4,5\}$ numbers.I should generate following 4 pairings of numbers where there will be 3 pairs in each pairing s.t


each number should be in one pair and also every number should be paired
a pair(like 0-1) should be present in only one of the pairing. and also every possible pair should be present somewhere


i)   0-1   , 2-3  ,4-5

ii)  0-4   , 1-2  ,3-5

iii) 0-3   , 1-4  ,2-5

iv)  0-2   , 1-5  ,3-4

v)   0-5   , 1-3  ,2-4

similarly if I have N numbers. I need $(N-1)$ pairing of numbers s.t  in each pairing there are $N/2$ pairs.

essentially this is grouping $\binom{n}{2}$ combinations into  $n-1$ groups s.t each number is present exactly once in each group
As pointed out by @Pseudonym, this problem is identical to finding a round robin tournament schedule. A straightforward implementation would be the following:

def get_sets(a: list):
    # Simple implementation of
    # https://nrich.maths.org/1443
    center, *rest = a
    for _ in range(len(rest)):
        rest = rest[1:] + rest[:1] # put 1st element to back of list
        solution = [[center, rest[len(rest) // 2]]] # combine middle element with center
        for i in range(len(rest) // 2):
            solution.append([rest[i], rest[~i]]) # combine i-th element from front with i-th from back
        yield solution

for s in get_sets(list(range(50))):
    print(s)


Note that this implementation creates a new list for each "set" in the output.
This is not strictly necessary, as the same result could be achieved by using only the initial list (actually array) and use smart indexing.