0

How can I go through a list, such that each pair of element is considered once?

For example:

myList = ["fruit", "bread", "meat", "cheese"]

I would need to compare:

fruit - bread
fruit - meat
fruit - cheese
bread - meat
bread - cheese
meat - cheese

Is there an efficient way to achieve this?

Rabinzel
  • 7,757
  • 3
  • 10
  • 30
GeekGeek4
  • 149
  • 9

0 Answers0