I've been trying to create a script where every possible combination of a list will be printed [where (1,2) and (2,1) will be counted as different entry]. For example:
c = [1,2]
# do something magical
print(c with magical stuff)
>>>[(1), (2), (1, 1), (1, 2), (2, 1), (2, 2)]
I've tried itertools.permutations. It shows output as >>> () (1,) (2,) (1, 2) (2, 1). However, it doesn't include (1, 1) and (2,2)
Any help will be hugely appreciated. I'm new to coding (I'm very fluent in printing "Hello World!" though :3)