human
Find sum of factorials in an array | Function to return the factorial of n.
Function to return the sum of factorials of the array elements.
To store the required sum.
Add factorial of all the elements.
Driver code"
Solution in Python:
assistant
#Here is code to find sum of factorials in an array and the other steps required.
 def factorial ( n ) :
	f = 1 ;
	for i in range ( 1 , n + 1 ) :
		f *= i ;
	return f ;
def sumFactorial ( arr , n ) :
	s = 0 ;
	for i in range ( 0 , n ) :
		s += factorial ( arr [ i ] ) ;
	return s ;
arr = [ 7 , 3 , 5 , 4 , 8 ] ;
n = len ( arr ) ;
print ( sumFactorial ( arr , n ) ) ;