easy question, how to double a variable

David C Ullrich dullrich at sprynet.com
Mon Sep 21 14:50:23 EDT 2009


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.









  





More information about the Python-list mailing list