Answer the question
In order to leave comments, you need to log in
What should Python code look like to calculate the sum of factorial numbers?
I wrote a code for a simple factorial calculation, now I need the program to find the sum of the factorial numbers.
n = int(input())
f = 0
if n > 0: f = 1
for i in range(1,n+1):
f *= i
print(f)
Answer the question
In order to leave comments, you need to log in
you need to add the sum variable to the loop, which will add the factorial f to itself
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question