need help with:
finds all the possible products of an array
examples:
[2,3] > returns 2*3, 2, 3 in an array form [6,2,3] (order not necessary)
[3,7,13] > returns 3*7*13, 3*7, 7*13, 13*3, 3, 7, 13 in an array form [273, 21, 91, 39, 2, 7, 13] (order not necessary)
how to do?
i was thinking to assign all values of the array with True or False
like len(array) > gets 3 for [3,7,13]
and then assign a True or False value for array(1), array(2), and array(3)
if array(1) is True and array(2) is True and array(3) is False the multiply array(1) and array(2) together
repeat until all 8 possibilities are complete
000
001
010
011
100
101
110
111
remove 0.
but i'm not sure how to decide whether to multiply the array indexes or not based on the array() so i'm not sure how to do so someone tell me their brains.