I have a list [1,2,3,4,5]
which I iterate over twice with for loops.
for i in list:
for j in list:
print(i,j)
I do not care about the order of i and j and therefore I receive a lot of duplicates. For example 1,2 and 2,1 are the "same" for me. Same thing for 1,4 and 4,1 and 3,5 and 5,3 and so on.
I would like to remove these duplicates but do not really understand how I should go about doing so.