[Tutor] noob
Mary
sharky5000 at comcast.net
Mon Nov 29 06:57:06 CET 2010
Dear Tutors:
Thank you for your time.I am trying to do first assignment (ps1a+b) onMIT open study, finding the 1000th prime in part a and doing something with import.math and logs in part b, but I'm not there yet. The little build i did to find primes does fine until, for some reason, 95 shows up, and later other multiples of 5 jump into the mix without being invited.I end up almost 200 primes off by the 1000 count. Is it me? Have uninstalled and reinstalled 2.7 twice. Here is code:
per = 25
num = 3
yep = 0
while per > 0:
for den in range(2, num):
if num % den == 0:
num = num + 2
else: yep = (num)
print yep
per = per - 1
num = num + 2
thank you again,
M
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20101129/dd472885/attachment-0001.html>
More information about the Tutor
mailing list