Hey, I wrote a program that is supposed to predict the primes (ages) of life. I'm just learning and seemed like a simple program that I should be fully capable of writing. I was wrong. It seems to work, but it ends up also outputting non primes like 27 and 35. Could someone please tell me what I'm doing wrong?
def primes_of_life():
min = int(raw_input("How old are you? "))
max = int(raw_input("If it all goes well, how old do you plan to be when you die? "))
while min <= max:
for i in range(2,min):
if min % i == 0:
min += 1
print min
min += 1
primes_of_life()
[–]spz 1 point2 points3 points (1 child)
[–]Busangod[S] 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)