Re: [Tutor] help, thanks very much.

2008-01-16 Thread Alan Gauld
bill.wu [EMAIL PROTECTED] wrote i ask a easy question. why the first one havex,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 on

Re: [Tutor] help, thanks very much.

2008-01-16 Thread Kent Johnson
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

[Tutor] help, thanks very much.

2008-01-15 Thread bill.wu
i am new guy. i ask a easy question. why the first one havex,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(x)

Re: [Tutor] help, thanks very much.

2008-01-15 Thread Brendan Rankin
bill.wu bill.wws at gmail.com writes: i am new guy. i ask a easy question. why the first one havex,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 x as