Sum of n - 1 terms starting from 2 nd term
for i in range ( 1 , n ) : NEW_LINE INDENT fct = 1 NEW_LINE for j in range ( 1 , y + 1 ) : NEW_LINE INDENT fct = fct * j NEW_LINE DEDENT term = term * ( - 1 ) NEW_LINE m = term * math . pow ( x , y ) / fct NEW_LINE sum = sum + m NEW_LINE y += 2 NEW_LINE DEDENT return sum NEW_LINE