hdarwin

cstutoringcenter.com_Fibonacci Primes

Jan 10th, 2013
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.19 KB | None | 0 0
  1. import re
  2. sum = 0
  3. pett = re.compile("prime", re.IGNORECASE)
  4. pett2 = re.compile(":\s(:?\d+)")
  5. for x in open('list.txt', 'r'):
  6.     if pett.findall(x):
  7.         sum += 1
  8. else:
  9.     print sum
Advertisement
Add Comment
Please, Sign In to add comment