daily pastebin goal
41%
SHARE
TWEET

CSH2012 LAB12 factorial.py

calcpage Jun 1st, 2013 188 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/python
  2. #factorial.py    MrG    2013.0517
  3.  
  4. def fact(n):
  5.     if n==0:
  6.         return 1
  7.     else:
  8.         return n*fact(n-1)
  9.  
  10. print "i\tfact(i)"
  11. for i in range(100):
  12.     print i,"\t",fact(i)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top