On 17/04/06, Payal Rathod <[EMAIL PROTECTED]> wrote:
> Hi,
> I am now reading Alan's tut on Python, before that I have read a few other 
> tuts too.
> But I am not getting functions exactly. I mean what is the difference between,
>
> def func():
>         ....
>
> and
>
> def func(x):
>         ....
>
> When to use which? (please do not say "returns a value" for I do not 
> understand the meaning
> of the same)
>
> With warm regards,
> -Payal

The x is a name for a value that you pass in to the function. To call
the first function you would do
>>> func()

and the second function:
>>> func(5) # 5 is just an example it could be any value depending on
the function.
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to