On Wed, Jul 28, 2010 at 7:00 PM, Navkirat Singh <navkir...@gmail.com> wrote: > Hi, > > I had another question: > > What is the scope of a parameter passed to a function? I know its a very > basic question, but I am just sharpening my basics :) > > def func_something(x) > > return print(x+1); > > Does x become a local variable or does it stay as a module scoped variable? > > Though I think its local, but just want to be sure.
Yes, it's indeed local. Also, you may wish to instead direct similar basic questions to the Python Tutor mailinglist in the future: http://mail.python.org/mailman/listinfo/tutor Cheers, Chris -- http://blog.rebertia.com -- http://mail.python.org/mailman/listinfo/python-list