variable is local and global

Skip Montanaro skip at pobox.com
Sun Jul 25 22:49:42 EDT 2004


    Kyle> bash-2.05b$ ./version.py
    Kyle>    File "./version.py", line 11
    Kyle>      def make_acceptable(version):
    Kyle> SyntaxError: name 'version' is local and global

Change either the name of the global variable or the name of the parameter.
They can't both be named "version".

Skip



More information about the Python-list mailing list