easy question, how to double a variable

Brian Blais bblais at bryant.edu
Wed Sep 23 15:30:39 CEST 2009


On Sep 23, 2009, at 8:15 , Casey Webster wrote:

> Btw, I can't believe nobody provided the simplest literal solution:
>
> def twice(i):
>    return i, i
> --

or this one, which is possibly even more literal:

def twice(p):

    return "an int that is twice the value of the parameter"


twice("an int parameter")

-- 
Brian Blais
bblais at bryant.edu
http://web.bryant.edu/~bblais



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090923/201f242e/attachment.html>


More information about the Python-list mailing list