Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '''
- write a python factorial program for prime numbers between 0-100.
- '''
- def isPrime(n):
- if n<2: return False
- for i in range(2, n):
- if n%i==0: return False
- return True
- def fact(number):
- factorial = 1
- while number>=1:
- factorial *= number
- number -= 1
- return factorial
- def main():
- print ("Prime Factorial")
- for z in range (0, 100):
- if isPrime (z):
- print (z, fact (z))
- main()
Advertisement
Add Comment
Please, Sign In to add comment