I've searched high and low for a solution for my script, but with no luck.
I am trying to print every possible duo from a given list. Except, not printing duplicates such as (a, a). And not printing a combination twice such as if (a, b) has been printed, then (b, a) will not be printed.
FLAVORS = [
"Banana",
"Chocolate",
"Lemon",
"Pistachio",
"Raspberry",
"Strawberry",
"Vanilla",
]
for i in FLAVORS:
for j in FLAVORS:
if (i != j) :
print(i, j, sep=", ")
I've managed to not print duplicates such as (a, a). However, I am stuck on how to print a combination only once so if (a, b) is printed, (b, a) wont be printed.