On 2009-09-21, David C Ullrich <dullr...@sprynet.com> wrote: > On Sun, 20 Sep 2009 13:27:07 -0700, daggerdvm wrote: > >> Write the definition of a function twice , that receives an int >> parameter and returns an int that is twice the value of the parameter. >> >> how can i do this > > I don't think this can be done in Python. > > Looking at the Subject line I thought your problem was going > to be easy: There's only one float type in Python, so at least > in most implementations simply converting to float will > suffice to "double" a variable. > > But you actually want to return twice the value. I don't see > how to do that.
It's easy: def twice(i): return i return i -- Grant -- http://mail.python.org/mailman/listinfo/python-list