I wrote ths program that is supposed to print out the prime numbers between 100 and 200. (I added some extra print commands along the way so I could see where it was getting to.) Can anyone give me a hint as to why it stops at 137, while the script is checking this number?
Thanks!
Here is the script:
import math
import sys
index=100.0
checker=2.0
def start():
print("A")
global index
while index<=200.0:
fu1()
if index>200.0:
end()
def fu1():
print ("B")
print ("checker", checker)
print ("index", index)
global index
global checker
varb=index/checker
varb2=round(index/checker, 0)
if checker>=index:
print ("C")
print(index)
index=index+1.0
checker=2.0
start()
if varb2==varb:
print("D")
checker=2.0
index=index+1.0
start()
checker=checker+1.0
fu1()
def end():
print("E")
print("ENDED")
sys.exit()
start()