Published On Apr 22, 2022
#python #12thpython #practicalexam
Write a program to calculate the factorial of the given number using for loop
brief explanation :
num = int(input("Enter a Number: "))
if (num==0):
fact = 1
fact = 1
for i in range(1,num+1):
fact = fact * i
print("Factorial of ", num, " is ", fact)
show more