Exemplo n.º 1
0
def test2():
	f = sieve.sieve_i()
	while f.size < 10:
		f.next()
	list = f.list
	print "Test if expect number shows in sequence"
	print ""
	assert list[1]  == 3
	print "assert list[1] == 3: Seccess"
	assert list[2]  == 5
        print "assert list[2] == 5: Seccess"
Exemplo n.º 2
0
def test3(n):
	print "Test is a number is prime. Here we use 233"
	print ""
	f = sieve.sieve_i()
	while f.size < n:
		f.next()
	list = f.list
	for i in list:
		if i == n:
		   print n,"is prime"
		   flag = 1
		   break
	if flag !=1:
	  print "Damn!", n, "is not prime!"
Exemplo n.º 3
0
def test1():
	f = sieve.sieve_i()
	while f.size < 10:
		f.next()
	print f.list