[Tutor] Advice for my function, isPrime(n), please

Marc Tompkins marc.tompkins at gmail.com
Mon Jul 21 19:29:53 CEST 2008


On Mon, Jul 21, 2008 at 10:20 AM, Daniel Sarmiento <dsarmientos at gmail.com>
wrote:

> What about the following function?
>
> if x == 0:
>    return False
> return True
>
>
> I am a beginner, but I think it is more clear (at least to me) what
> the function does. And it is only one line longer than
>
> value = (x != 0)
> return value
>

How about

> return (x!=0)
>
?

Short and cryptic!


-- 
www.fsrtechnologies.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20080721/91beb024/attachment.htm>


More information about the Tutor mailing list