So I have this:
a = [[4, 8], [5, 6, 9, 10], [13]]
I want to get the difference (subtraction) between:
4 - 5 = a[0][0] - a[1][0]
4 - 6 = a[0][0] - a[1][1]
4 - 9 = a[0][0] - a[1][2]
4 - 10 = a[0][0] - a[1][3]
and then move on to the 8:
8 - 5 = a[0][1] - a[1][0]
8 - 6 = a[0][1] - a[1][1]
...
And so on for all the sub-lists
Any ideas?
EDIT: The other comparisons would look like this:
5 - 13 = a[1][0] - a[2][0]
6 - 13 = a[1][1] - a[2][0]
9 - 13 = a[1][2] - a[2][0]
10 - 13 = a[1][3] - a[2][0]
And because this is the second to last list, then it stops.
I’m trying to implement the Quine-McCluskey method to minimize logic expressions.
Assuming that after finishing
a[0][1] - a[1][x]you want to continue witha[0][0] - a[2][0], and then eventually also doa[1][0] - a[2][0]etc.:As a list comprehension: