#find factorial of a number x = int(input("Enter the number : ")) factorial=1 for i in range(1,x+1): factorial = factorial*i print("the factorial of "+str(x)+" is "+str(factorial)) Output Enter the number : 5 the factorial of 5 is 120
No comments