I have all possible combinations of operations between numbers in a list:
list = ['2','7','8']
7+8*2
8+7*2
2*8+7
2+8*7
2-8*7
8-2/7
etc
I want to know if it's possible to say that operations like ('7*2+8' and '8+7*2' and '2*7+8') or (7*8*2 and 2*8*7 and 7*2*8) etc. are the same. I want to know how take only one operation if it's the same operation.
This is my code to create these different operations:
Op = ['+','-','*','/']
array = []
for i in Op:
array.append(string1 + i + string2)
return array