> > Thank you for your comment which, if I understand you correctly, implies > > that prime numbers greater than 25 will not be recognised. Surely, that > > cannot be correct. However, if it is correct, could you please > > demonstrate what you mean for my education. > > More precisely, it will give an incorrect answer for any non-prime that is > not divisible by 2 or 3, for example 25. > > >>> def test(n): > ... if n % 2 != 0 and n % 3 != 0: > ... print n, 'is prime' > ... > >>> test(2) > >>> test(3) > > Hmm, not looking so good for 2 and 3 either... > >>> test(4) > >>> test(5) > 5 is prime > >>> test(25) > 25 is prime > > Not so sure about that one either!
How right you and Glen are and I am not very bright!! I must think again and thanks. Norman _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor