Question: Write a program which can compute the factorial of a given numbers.
The results should be printed in a comma-separated sequence on a single line.
Suppose the following input is supplied to the program:
8
Then, the output should be:
40320
Hints: In case of input data being supplied to the question, it should be assumed to be a console input.
Solution:
#fact(x) method to calculate factorial
def fact(x):
if x == 0:
return 1
return x * fact(x - 1)
x=int(input())
print fact(x)
I am a student and nowadays I am facing a big issue as I am unable to complete my python assignment and I am stuck on this. I am thinking to select any assinmnt service that’s why I am reading bestessays.com reviews about the best services in the country.