bill.wu wrote:
>
> i am new guy.
> i ask a easy question.
There is no need to ask twice.
Please post messages in plain-text, not HTML.
Kent
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
"bill.wu" <[EMAIL PROTECTED]> wrote
> i ask a easy question.
>
> why the first one have"x",the second one
> doesn't have "x". what is different?
The first is using x as the name of a parameter
of the function and is only used inside the function.
The second one takes no parameter and relies
bill.wu gmail.com> writes:
>
>
>
> i am new guy.
> i ask a easy question.
>
> why the first one have"x",the second one doesn't have "x". what
> is different? when write "x",when don't write "x".
>
> in my point,the second one don't def variable.
>
>
Variable scope. By declaring the
i am new guy.
i ask a easy question.
why the first one have"x",the second one doesn't have "x". what is different?
when write "x",when don't write "x".
in my point,the second one don't def variable.
(1)
def func(x):
print 'x is', x
x = 2
print 'Changed local x to', x
x = 50
func