222k views
24 votes
Write a python computer program that prints out a factorial.

N factorial (written N!) is defined as

N * (N-1) * (N-2) * ... * 1
For example, 4! is

4 * 3 * 2 * 1 = 24
Ask the user for the value of N. Use for loops and variables to print out N factorial.

(Hint: You solve factorial by multiplying the numbers from 1 all the way up to N together. You need a variable to store the result.)

User DMe
by
5.4k points

1 Answer

8 votes

I included my code in the picture below.

Write a python computer program that prints out a factorial. N factorial (written-example-1
User George Houpis
by
5.3k points