T
T
Tokach_Link2020-04-30 22:33:48
Python
Tokach_Link, 2020-04-30 22:33:48

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

2 answer(s)
1
101-s, 2020-04-30
@Tokach_Link

you need to add the sum variable to the loop, which will add the factorial f to itself

D
Dr. Bacon, 2020-04-30
@bacon

Go and google, if you can’t think, you’re tired of all sorts of ignoramuses.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question