Archief voor 17 februari 2007

17
Feb
07

class PrimeList

class PrimeList:

“”" This class will contain a list of the prime numbers smaller than ‘maximum’ for use with the Tal class. “”"

value=[]

def __init__(self, maximum):

“”"”"”

self.value = []

for n in range(2,maximum):

a=0

for x in range(2,n):

if n%x==0:

a=1

if a==0:

self.value = self.value + [n]

def __contains__(self, b):

“”" Returns true if b is a prime smaller than maximum( and enables ‘in’). “”"

if b in self.value:

return True

else:

return False




Blog Stats

  • 3,612 hits

del.icio.us

Time

objBE = new Object;objBE.wtsclock = "wtsclock024.swf";objBE.color = "000000";objBE.wtsid = "BE";objBE.width = 100;objBE.height = 100;objBE.wmode = "transparent";showClock(objBE);

Antwerp

Calendar / Kalender

februari 2007
M D W D V Z Z
« Jan   Mrt »
 1234
567891011
12131415161718
19202122232425
262728  

a