Python program to find a factorial by passing a parameter using function?

Python program to find a factorial by passing a parameter using function?


def factorial(value):
    fact = 1
    for i in range(1, x+1):
        fact = fact * i
    return fact

x = int(input("Enter number to find factorial : "))
print(factorial(x))

No comments:

Post a Comment

INSTAGRAM FEED

@Python forest