Computer Science, asked by tewarilavi6, 2 months ago

write a program to calculate factorial of any number entered by the user in python. this is very important who knows answer then only reply I have to submit​

Answers

Answered by valeriy69
1

\large\mathsf\color{pink}{Solution\: using\: python\: 3}

def calc_factorial(n):

if n == 0 or n == 1:

return 1

factorial = 1

for i in range(1, n + 1):

factorial *= i

return factorial

n = int(input("enter num: "))

print(f"factorial: {calc_factorial(n)}")

\large\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Similar questions