Permalink
Browse files

p7 in python

  • Loading branch information...
1 parent a0502f3 commit c5c2096453d2f2daf6d9222f76d158c0c4e02e8d @randm989 committed Apr 7, 2012
Showing with 19 additions and 0 deletions.
  1. +19 −0 python/p7.py
View
@@ -0,0 +1,19 @@
+#!/usr/bin/python
+
+def isPrime(num):
+ i=2
+ while i*i <= num:
+ if num%i==0:
+ return False
+ i+=1
+ return True
+
+
+i=0
+cnt=2
+while i < 10001:
+ if isPrime(cnt):
+ i+=1
+ print i,cnt
+ cnt+=1
+

0 comments on commit c5c2096

Please sign in to comment.