Created
May 16, 2011 01:19
-
-
Save tarsisazevedo/973755 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from unittest import TestCase | |
from primos import num_eh_primo | |
class Test10001Primos(TestCase): | |
def test_achar_sexto_primo(self): | |
self.assertEquals(13, achar_n_primo(n=6)) | |
def test_achar_10001_primo(self): | |
self.assertEquals(104743, achar_n_primo(n=10001)) | |
def achar_n_primo(n): | |
flag = 0 | |
numero = 0 | |
while flag != n: | |
if num_eh_primo(numero): | |
flag += 1 | |
if flag == n: | |
break | |
numero += 1 | |
else: | |
numero += 1 | |
return numero |
Author
tarsisazevedo
commented
May 16, 2011
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment