def twice(parameter = 2)
return 4
2009/9/20 daggerdvm :
> 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
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
http
I come from a scientific background, so my approach to the solution of
this problem is a little different.
It makes use of some numerical approximations, but that's not
necessarily a bad thing, because it helps avoid singularities. So it
could be a little more robust than other solutions presented
In article ,
daggerdvm wrote:
>you brain needs error checking!
Whose brain? At least I know this:
Your brain is beyond repair. Go for a brain transplant.
Groetjes Albert
--
--
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
alb...@spe
On 9月22日, 上午4时49分, daggerdvm wrote:
> you brain needs error checking!
this kid knows error checking...may be he know exceptions as well
--
http://mail.python.org/mailman/listinfo/python-list
On Sep 24, 5:51 am, Iain King wrote:
> On Sep 23, 7:36 pm, David C Ullrich wrote:
>
>
>
> > On Tue, 22 Sep 2009 02:34:53 +, Steven D'Aprano wrote:
> > > On Mon, 21 Sep 2009 13:50:23 -0500, David C Ullrich wrote:
>
> > >> But you actually want to return twice the value. I don't see how to do
>
On Sep 23, 7:36 pm, David C Ullrich wrote:
> On Tue, 22 Sep 2009 02:34:53 +, Steven D'Aprano wrote:
> > On Mon, 21 Sep 2009 13:50:23 -0500, David C Ullrich wrote:
>
> >> But you actually want to return twice the value. I don't see how to do
> >> that.
>
> > What?
>
> > Seriously?
>
> You're sa
On Tue, 22 Sep 2009 02:34:53 +, Steven D'Aprano wrote:
> On Mon, 21 Sep 2009 13:50:23 -0500, David C Ullrich wrote:
>
>> But you actually want to return twice the value. I don't see how to do
>> that.
>
> What?
>
> Seriously?
You're saying it _can_ be done in Python? They must have added
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 par
On Sep 22, 9:57 am, Grant Edwards wrote:
>
> No, no, no. The plan is to do his homework for him so that
> he's incompetent when he graduates and won't be competition for
> the rest of us who did do our homework.
Don't forget the Peter principal --- we might end up working for him!
Btw, I can't
On Tue, 22 Sep 2009 07:41:11 -0700, Hyuga wrote:
>> > Forget ethical. We can do his homework for him, we can perhaps pass
>> > exams for him, maybe graduate for him, and then with our luck, he'll
>> > get a job in our office and we get to do his work for him.
>>
>> No, no, no. The plan is to do
On Mon, 21 Sep 2009 21:49:50 +0100, daggerdvm wrote:
you brain needs error checking!
Your post, by contrast, needs grammar checking.
--
Rhodri James *-* Wildebeest Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, Sep 22, 2009 at 11:58 PM, Mahmoud Abdelkader
wrote:
> hi looking for help catching up in a class and overall to get me better
> than i am now. I can pay you by the week or per hour.
>
Wow. I'd feel guilty getting paid doing that. Sounds all too easy.
I hope he is actually learning, not j
On Sep 22, 9:57 am, Grant Edwards wrote:
> On 2009-09-22, Mel wrote:
>
> > Tim Roberts wrote:
>
> >> daggerdvm wrote:
>
> >>>carl banks.you are a dork
>
> >> What are you, eleven years old?
>
> >> Look, you asked us to answer for you what is CLEARLY a homework question.
> >> It is unethi
On 2009-09-22, Mel wrote:
> Tim Roberts wrote:
>
>> daggerdvm wrote:
>>>
>>>carl banks.you are a dork
>>
>> What are you, eleven years old?
>>
>> Look, you asked us to answer for you what is CLEARLY a homework question.
>> It is unethical for you to ask that, and it is unethical for us
http://codingforums.com/showthread.php?s=e26b8b0aabc69745ef24a855b1a0fc83&t=177529
It seems that this dude really is looking for how to double a variable...
"""
hi looking for help catching up in a class and overall to get me better than
i am now. I can pay you by the week or per hour.
everythin
Mel writes:
> Tim Roberts wrote:
> > Look, you asked us to answer for you what is CLEARLY a homework
> > question. It is unethical for you to ask that, and it is unethical
> > for us to answer it.
>
> Forget ethical. We can do his homework for him, we can perhaps pass
> exams for him, maybe gradu
Tim Roberts wrote:
> daggerdvm wrote:
>>
>>carl banks.you are a dork
>
> What are you, eleven years old?
>
> Look, you asked us to answer for you what is CLEARLY a homework question.
> It is unethical for you to ask that, and it is unethical for us to answer
> it.
Forget ethical. We c
On Sep 21, 1:27 am, 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
Please note that most mails here are humorous - as should be expected
for a language named af
On Monday 21 September 2009 22:49:50 daggerdvm wrote:
> you brain needs error checking!
try:
return response()
except Troll,e:
raise dontFeed(anymore=True)
\d
--
home: http://otherwise.relics.co.za/
2D vector animation : https://savannah.nongnu.org/projects/things/
Font manager : https://savann
On Mon, 21 Sep 2009 13:46:31 -0700 (PDT) daggerdvm
wrote:
> u don't want to answerthen why post?...get lost.
You're not doing yourself a favor with this attitude, much less
displaying it. You asked a question that you could have solved with 1
hour's worth of reading at most (much
you brain needs error checking!
--
http://mail.python.org/mailman/listinfo/python-list
daggerdvm wrote:
what are you retarded? this is not a test you moron, i can ask all
the questions i want about it.
You seem to have forgotten to CC the list. Let me help show the
world your "mad skillz" -- at replying, at programming, at
orthography, at interpersonal communication...
Sur
On Monday, 21 September 2009 22:50:31 daggerdvm wrote:
> carl banks.you are a dork
No mister_do_my_homework, he is not.
He is actually a respected member
of this little community.
You, however, are beginning to look like one.
Why do you not come clean - tell us what you are doing,
sho
On Sep 20, 10:27 pm, 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 will stop this theatre...
as you should know, you want your function to make arithmetic
op
daggerdvm wrote:
>
>carl banks.you are a dork
What are you, eleven years old?
Look, you asked us to answer for you what is CLEARLY a homework question.
It is unethical for you to ask that, and it is unethical for us to answer
it.
As others have said, show us what you TRIED, and we can h
On 2009-09-21, David C Ullrich 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
But you actually want to return twice the value. I don't see
how to do that.
Ah, I think I see...returning more than once is done with the
"yield" keyword:
def f(param):
yield param
yield param
That returns twice the integer parameter... :-D
However, the OP was instructed to "Wri
On Mon, 21 Sep 2009 13:50:23 -0500, David C Ullrich wrote:
> But you actually want to return twice the value. I don't see how to do
> that.
What?
Seriously? You're not just yanking the OP's chain???
--
Steven
who normally does quite well detecting sarcasm in writing
--
http://mail.python.org
On Sep 21, 1:46 pm, daggerdvm wrote:
> u don't want to answerthen why post?...get lost.
I eat children...
--
http://mail.python.org/mailman/listinfo/python-list
daggerdvm wrote:
u don't want to answerthen why post?...get lost.
On the contrary! We *do* want to answer. Prizes are awarded based on
the most outlandish yet correct answer, on the most literal answer, and
on the funniest answer!
Ridiculous questions like yours are what m
carl banks.you are a dork
--
http://mail.python.org/mailman/listinfo/python-list
u don't want to answerthen why post?...get lost.
--
http://mail.python.org/mailman/listinfo/python-list
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 though
Steven D'Aprano 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
Yes, that certainly is an easy question.
Here's my solution:
class MultiplierFactory(object):
[snip a marvel of
On Sep 20, 1:27 pm, 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
Simple:
Once you define the function, "copy" it using your editor commands,
then "paste" it
On Mon, Sep 21, 2009 at 6:27 AM, 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 thought it was easier to implement this twice function than to find this
ma
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
Yes, that certainly is an easy question.
Here's my solution:
class Multiplier
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
Read over your textbook and the notes you took in class -- I'm
sure therein you'll find how to define functions, how to
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
That's a very basic question. Try a tutorial.
--
http://mail.python.org/mailman/listinfo/python-list
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
--
http://mail.python.org/mailman/listinfo/python-list
40 matches
Mail list logo