Re: easy question, how to double a variable

2009-12-28 Thread Tom Kermode
def twice(parameter = 2) return 4 2009/9/20 daggerdvm dagger...@yahoo.com:  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

Re: easy question, how to double a variable

2009-10-02 Thread Albert van der Horst
In article fa454992-d61a-4fb7-b684-c8535bce5...@e18g2000vbe.googlegroups.com, daggerdvm dagger...@yahoo.com 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,

Re: easy question, how to double a variable

2009-10-02 Thread Chris Colbert
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

Re: easy question, how to double a variable

2009-09-24 Thread Iain King
On Sep 23, 7:36 pm, David C Ullrich dullr...@sprynet.com 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

Re: easy question, how to double a variable

2009-09-24 Thread Pablo Torres N.
On Sep 24, 5:51 am, Iain King iaink...@gmail.com wrote: On Sep 23, 7:36 pm, David C Ullrich dullr...@sprynet.com 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

Re: easy question, how to double a variable

2009-09-24 Thread devilkin
On 9月22日, 上午4时49分, daggerdvm dagger...@yahoo.com 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

Re: easy question, how to double a variable

2009-09-23 Thread Rhodri James
On Mon, 21 Sep 2009 21:49:50 +0100, daggerdvm dagger...@yahoo.com 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

Re: easy question, how to double a variable

2009-09-23 Thread Steven D'Aprano
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 his homework

Re: easy question, how to double a variable

2009-09-23 Thread Casey Webster
On Sep 22, 9:57 am, Grant Edwards inva...@invalid.invalid 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

Re: easy question, how to double a variable

2009-09-23 Thread Brian Blais
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

Re: easy question, how to double a variable

2009-09-23 Thread David C Ullrich
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 something

Re: easy question, how to double a variable

2009-09-22 Thread Processor-Dev1l
On Sep 20, 10:27 pm, daggerdvm dagger...@yahoo.com 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

Re: easy question, how to double a variable

2009-09-22 Thread Hendrik van Rooyen
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,

Re: easy question, how to double a variable

2009-09-22 Thread Tim Chase
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... Sure

Re: easy question, how to double a variable

2009-09-22 Thread daggerdvm
you brain needs error checking! -- http://mail.python.org/mailman/listinfo/python-list

Re: easy question, how to double a variable

2009-09-22 Thread Andreas Waldenburger
On Mon, 21 Sep 2009 13:46:31 -0700 (PDT) daggerdvm dagger...@yahoo.com 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

Re: easy question, how to double a variable

2009-09-22 Thread Donn
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 :

Re: easy question, how to double a variable

2009-09-22 Thread koranthala
On Sep 21, 1:27 am, daggerdvm dagger...@yahoo.com 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

Re: easy question, how to double a variable

2009-09-22 Thread Mel
Tim Roberts wrote: daggerdvm dagger...@yahoo.com 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

Re: easy question, how to double a variable

2009-09-22 Thread Ben Finney
Mel mwil...@the-wire.com 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,

Re: easy question, how to double a variable

2009-09-22 Thread Mahmoud Abdelkader
http://codingforums.com/showthread.php?s=e26b8b0aabc69745ef24a855b1a0fc83t=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. everything

Re: easy question, how to double a variable

2009-09-22 Thread Grant Edwards
On 2009-09-22, Mel mwil...@the-wire.com wrote: Tim Roberts wrote: daggerdvm dagger...@yahoo.com 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

Re: easy question, how to double a variable

2009-09-22 Thread Hyuga
On Sep 22, 9:57 am, Grant Edwards inva...@invalid.invalid wrote: On 2009-09-22, Mel mwil...@the-wire.com wrote: Tim Roberts wrote: daggerdvm dagger...@yahoo.com wrote: carl banks.you are a dork What are you, eleven years old? Look, you asked us to answer for you what is

Re: easy question, how to double a variable

2009-09-22 Thread Xavier Ho
On Tue, Sep 22, 2009 at 11:58 PM, Mahmoud Abdelkader mabdelka...@gmail.comwrote: 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

Re: easy question, how to double a variable

2009-09-21 Thread Carl Banks
On Sep 20, 1:27 pm, daggerdvm dagger...@yahoo.com 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,

Re: easy question, how to double a variable

2009-09-21 Thread Tim Chase
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

Re: easy question, how to double a variable

2009-09-21 Thread daggerdvm
u don't want to answerthen why post?...get lost. -- http://mail.python.org/mailman/listinfo/python-list

Re: easy question, how to double a variable

2009-09-21 Thread daggerdvm
carl banks.you are a dork -- http://mail.python.org/mailman/listinfo/python-list

Re: easy question, how to double a variable

2009-09-21 Thread Ethan Furman
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

Re: easy question, how to double a variable

2009-09-21 Thread Sean DiZazzo
On Sep 21, 1:46 pm, daggerdvm dagger...@yahoo.com wrote: u don't want to answerthen why post?...get lost. I eat children... -- http://mail.python.org/mailman/listinfo/python-list

Re: easy question, how to double a variable

2009-09-21 Thread Steven D'Aprano
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 --

Re: easy question, how to double a variable

2009-09-21 Thread Tim Chase
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 Write

Re: easy question, how to double a variable

2009-09-21 Thread Grant Edwards
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

Re: easy question, how to double a variable

2009-09-21 Thread Tim Roberts
daggerdvm dagger...@yahoo.com 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

Re: easy question, how to double a variable

2009-09-20 Thread MRAB
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

Re: easy question, how to double a variable

2009-09-20 Thread Tim Chase
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

Re: easy question, how to double a variable

2009-09-20 Thread Steven D'Aprano
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

Re: easy question, how to double a variable

2009-09-20 Thread Xavier Ho
On Mon, Sep 21, 2009 at 6:27 AM, daggerdvm dagger...@yahoo.com 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