Find Factorial of a Given Number Using Function in python - Softwoodcoder

preview_player
Показать описание
Hello Friends,
In this video we will write a program for finding factorial of a given number using function.
So, here we create a function whose named factorial using def keyword and also pass one parameter named m.Inside function we write are logic for factorial.
The function works when we call it and after taking input we call function and pass arguments.

Thanks for watching...
and subscribe for more latest videos....
Рекомендации по теме
Комментарии
Автор

def factorial(n):
f=1
for i in range(1, n+1):
f=f*i
return f
num=int(input("Enter a number:"))
print("The Factorial of number", num, "is", factorial(num))
factorial(num)

Harbingersknight