[Tutor] Defining a function (Joseph Q.)
cyresse at gmail.com
Tue Apr 12 15:27:32 CEST 2005
>>> def foo(x):
... print x
What goes in the brackets is simply the arguments that foo() works with.
... return a + b
>>> sum = foo(5,10)
>>> conjun = foo("Hi ", "Dave")
On Apr 12, 2005 12:23 PM, Joseph Quigley <cpu.crazy at gmail.com> wrote:
> Well, now I've learned what def is good for. But what could I put in the
> parenthesis of def foo():?
> Of course self is always available, but what would maybe def foo(number1):do? An error right? So I now repeat my self, what else besides self could I
> put in there?
> Tutor maillist - Tutor at python.org
'There is only one basic human right, and that is to do as you damn well
And with it comes the only basic human duty, to take the consequences.'
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor