human
Write me a code to replace every element of the array by product of all other elements and the other steps required given the following:
Replace every element of the array by product of all other elements | Python 3 program to Replace every element by the product of all other elements.
Calculate the product of all the elements.
Replace every element product of all other elements.
Driver Code.
Print the modified array ."
Solution in Python:
assistant
#Here is code to replace every element of the array by product of all other elements and the other steps required.
 def ReplaceElements ( arr , n ) :
	prod = 1
	for i in range ( n ) :
		prod *= arr [ i ]
	for i in range ( n ) :
		arr [ i ] = prod // arr [ i ]
if __name__ == " _ _ main _ _ " :
	arr = [ 2 , 3 , 3 , 5 , 7 ]
	n = len ( arr )
	ReplaceElements ( arr , n )
	for i in range ( n ) :
		print ( arr [ i ] , end = " ▁ " )