I have 2 lists
Numberset1 = [10,11,12]
Numberset2 = [1,2,3,4,5]
and i want to display output by manipulating the lists, the expected output is
10 1
10 2
10 3
10 4
10 5
11 2
11 3
11 4
11 5
11 1
12 3
12 4
12 5
12 1
12 2
Since the 2nd number in first list should start from the second number from the second list i tried enumerating it and created another list
test=[j for i, o in enumerate(Numberset2) for j in Numberset2[i:] + Numberset2[:i] ]
The code i have tried is as follows
Numberset1 = [10,11,12]
Numberset2 = [1,2,3,4,5]
test=[j for i, o in enumerate(Numberset2) for j in Numberset2[i:] + Numberset2[:i] ]
for D in Numberset1:
for j in test:
print(D,j)
The output i am getting is
10 1
10 2
10 3
10 4
10 5
10 2
10 3
10 4
10 5
10 1
10 3
10 4
10 5
10 1
10 2
10 4
10 5
10 1
10 2
10 3
10 5
10 1
10 2
10 3
10 4
11 1
11 2
11 3
11 4
11 5
11 2
11 3
11 4
11 5
11 1
11 3
11 4
11 5
11 1
11 2
11 4
11 5
11 1
11 2
11 3
11 5
11 1
11 2
11 3
11 4
12 1
12 2
12 3
12 4
12 5
12 2
12 3
12 4
12 5
12 1
12 3
12 4
12 5
12 1
12 2
12 4
12 5
12 1
12 2
12 3
12 5
12 1
12 2
12 3
12 4
I know that i am iterating the test and that is why i am getting these many numbers, how can i make sure that i am getting only the expected output