Python program for find factorial of a given number using function

0
22
def factorial(num):    #function definition
    fact=1
    for i in range(1, num+1):      #for loop for finding factorial
        fact=fact*i
    return fact       #return factorial 
#____main_____
number=int(input("Please enter any number for find factorial: "))
result=factorial(number)  #function call and assign the value to variable result
print("The factorial of %d = %d"%(number,result))

      Output 1:
              Please enter any number for find factorial: 5
              The factorial of 5 = 120
      Output 2:
              Please enter any number for find factorial: 8
              The factorial of 8 = 40320
Python program for find factorial of a given number using function Python Program To Find Factorial Using Function program for find factorial of a given number using function in python write a program for find factorial of a given number using function in python write a program to find factorial using function in python write a program for find factorial using function in python write a program to find factorial using function program to find factorial using function program for find factorial using function factorial program using function factorial program write a program to finding factorial using function in python factorial program in python using function program to find factorial of a number using function in python function program in python example of function in python

LEAVE A REPLY

Please enter your comment!
Please enter your name here