Product of values of all possible non | Function to find product of all elements in all subsets ; Driver Code
def product ( a , n ) : NEW_LINE INDENT ans = 1 NEW_LINE val = pow ( 2 , n - 1 ) NEW_LINE for i in range ( n ) : NEW_LINE INDENT ans *= pow ( a [ i ] , val ) NEW_LINE DEDENT return ans NEW_LINE DEDENT n = 2 NEW_LINE a = [ 3 , 7 ] NEW_LINE print ( product ( a , n ) ) NEW_LINE