Priyanshu_Gupta

Factorial

Aug 9th, 2020 (edited)
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. def fun():
  2.     print("Enter Your Number")
  3.     a=int(input())
  4.     fact = 1
  5.     for i in range(a):
  6.         fact=fact*(i+1)
  7.     print("Your Factoril is ",+fact)
  8.  
  9. def fun2():
  10.     print("Enter Your Number")
  11.     b=int(input())
  12.     if b==1:
  13.         return 1
  14.         print(b)
  15.     else:
  16.        b= b*(b-1)
  17.     print("Your Factorial is ",+ b)
  18.  
  19. fun()
  20. fun2()
Add Comment
Please, Sign In to add comment