human
Product of all Subarrays of an Array | Function to find product of all subarrays.
Variable to store the product.
Compute the product while traversing for subarrays.
Printing product of all subarray.
Driver code.
Function call"
How can the above be solved in Python?
assistant
#Here is code to product of all Subarrays of an Array and the other steps required.
 def product_subarrays ( arr , n ) :
	res = 1 ;
	for i in range ( n ) :
		product = 1
		for j in range ( i , n ) :
			product *= arr [ j ] ;
			res = res * product
	print ( res ) ;
if __name__ == ' _ _ main _ _ ' :
	arr = [ 10 , 3 , 7 ] ;
	n = len ( arr ) ;
	product_subarrays ( arr , n ) ;