Source Code:
(back to article)
import itertools my_list = [1, 2, 3] combinations = list(itertools.combinations_with_replacement(my_list, 2)) print(combinations)
Result:
Report an issue