Sum of series 1 * 1 ! + 2 * 2 ! + …… . . + n * n ! | Python program to find sum of the series . ; Function to calculate required series ; Drivers code
def factorial ( n ) : NEW_LINE INDENT res = 1 NEW_LINE for i in range ( 2 , n + 1 ) : NEW_LINE INDENT res = res * i NEW_LINE DEDENT return res NEW_LINE DEDENT def calculateSeries ( n ) : NEW_LINE INDENT return factorial ( n + 1 ) - 1 NEW_LINE DEDENT n = 3 NEW_LINE print ( calculateSeries ( n ) ) NEW_LINE