Here is the code that doesn't work.
Thanks for posting the code. What "doesn't work" mean?
error messages?
unexpected results?
or what?
There are several problems in your code.
- The candidates you are testing. Walk thru the program and list a few
of them and see if you can determine that problem.
- Counting primes as you discover them. Same advice as above.
- indentation is screwed up. Please use only spaces - no tabs.
primeCount = 0
primeCandidate = 2
While primeCount <= 1000:
isPrime = True
primeCandidate = primeCandidate + 2
for x in range(2, primeCandidate):
if primeCandidate % x == 0:
print primeCandidate, "equals", x, "*", primeCandidate/x
isPrime = False
Print primeCandidate
break
If isPrime:
primeCount = primeCount + 2
Print primeCandidate
--
Bob Gailer
Chapel Hill NC
919-636-4239
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor