Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. N = 3
  2. res = 1
  3. prev_fact = None
  4.  
  5. for i in range(1, N+1):
  6. if i == 1:
  7. fact = 1
  8. else:
  9. fact = prev_fact * i
  10. res *= fact
  11. prev_fact = fact
  12.  
  13. print(res)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement