Program:

def fact(n):
if n==0:
    return 1
if n==1:
    return 1
return n*fact(n-1)

n1=int(input("Enter the Number:"))
if n1>=0:

    print("-->>Factorial=",fact(n1))
else:
print("Factorial of Negative Number Doesn't Exist.")

Expected O/P:

Enter the Number:5
-->>Factorial= 120