oops, wrong address. When will reply-to tag appear on the Python mailing list? =/
Good idea, Steven and MRAB. I changed my code to the following: def nPrime(self, n): "Returns nth prime number, the first one being 2, where n = 0. When n = 1, it returns 3." for x in range(n+2): try: return self.primes[n] except IndexError: self.next() And it's definitely better. Thanks a ton guys. (n+2 because after looping the maximum number of times, it needs to try returning the value again.) It works just as well as the previous version, but slightly safer on my part... and I can adapt this in my future coding habits. Thanks again. Ching-Yun "Xavier" Ho, Technical Artist Contact Information Mobile: (+61) 04 3335 4748 Skype ID: SpaXe85 Email: cont...@xavierho.com Website: http://xavierho.com/
-- http://mail.python.org/mailman/listinfo/python-list