i dont know what happend
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
#import time
|
||||
print("Prime number calc")
|
||||
checked = []
|
||||
primes=[]
|
||||
now=1
|
||||
|
||||
def is_ganz(zahl):
|
||||
try:
|
||||
return float(int(zahl)) == zahl
|
||||
except ValueError:
|
||||
return False
|
||||
|
||||
|
||||
def is_teilbar(nummer, teiler):
|
||||
geteilt=nummer/teiler
|
||||
return is_ganz(geteilt)
|
||||
|
||||
|
||||
|
||||
while True:
|
||||
now += 1
|
||||
#if is_teilbar(now, 50):
|
||||
# print("[debug]: das ist cheecked:"+str(checked))
|
||||
if not now in checked:
|
||||
x=0
|
||||
for i in checked:
|
||||
if is_teilbar(now, i):
|
||||
x += 1
|
||||
if x==0:
|
||||
primes.append(now)
|
||||
print(now)
|
||||
checked.append(now)
|
||||
#time.sleep(0.01)
|
||||
Reference in New Issue
Block a user