On Sep 20, 11:23 am, Peng Yu wrote:
> On Sun, Sep 20, 2009 at 9:37 AM, Grant Edwards
> wrote:
> > On 2009-09-20, Peng Yu wrote:
>
> >> Suppose I want to define a function that return the minimum number
> >> that can be represented.
>
> >> def f(x):
> >> #body
>
> >> That it, if I call f(10),
Peng Yu wrote:
On Sun, Sep 20, 2009 at 9:37 AM, Grant Edwards wrote:
On 2009-09-20, Peng Yu wrote:
Suppose I want to define a function that return the minimum number
that can be represented.
def f(x):
#body
That it, if I call f(10), f will return the minimum integer that can
be r
On 2009-09-20, Peng Yu wrote:
>> You might also want to read up on the type() builtin
>
> I want avoid using any 'if' statement.
Why?
> In C++, I can use template.
If you want to write C++ code, then you should use a C++
compiler.
> How to do not use 'if' statement in python?
In python you u
On Sun, Sep 20, 2009 at 9:37 AM, Grant Edwards wrote:
> On 2009-09-20, Peng Yu wrote:
>
>> Suppose I want to define a function that return the minimum number
>> that can be represented.
>>
>> def f(x):
>> #body
>>
>> That it, if I call f(10), f will return the minimum integer that can
>> be rep
On 2009-09-20, Peng Yu wrote:
> Suppose I want to define a function that return the minimum number
> that can be represented.
>
> def f(x):
> #body
>
> That it, if I call f(10), f will return the minimum integer that can
> be represented in the machine; if I cal f(10.5), f will return the
> min
On Sep 20, 1:15 pm, Peng Yu wrote:
> The problem is how to know what type of the argument and call the
> corresponding function.
>>> type(1)
>>> type(1.2)
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, Sep 20, 2009 at 12:46 AM, Daniel Fetchinson
wrote:
>> Suppose I want to define a function that return the minimum number
>> that can be represented.
>>
>> def f(x):
>> #body
>>
>> That it, if I call f(10), f will return the minimum integer that can
>> be represented in the machine; if I
> Suppose I want to define a function that return the minimum number
> that can be represented.
>
> def f(x):
> #body
>
> That it, if I call f(10), f will return the minimum integer that can
> be represented in the machine; if I cal f(10.5), f will return the
> minimum float that can be represent