On 7/13/2010 5:50 AM, Dipo Elegbede wrote:
I was trying to write a code that prints prime numbers between 1 and 20.
Other suggestions - you need only test divisors up to the square root of the candidate. - you can easily eliminate all even numbers and numbers divisible by 3. for i in range(0,7,3): isPrime(i-1) isPrime(i+1) -- Bob Gailer 919-636-4239 Chapel Hill NC _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor