Hello,

On Tue, 18 Apr 2006 19:05:06 -0700, [EMAIL PROTECTED] wrote:
> Here is my code:
> 
> cw = 0   #Computer wins total
> uw = 0   # User wins total
> 
> def win(who):
>     if who == 1:
>         cw = cw + 1    # computer win
>     elif who == 2:
>         uw = uw + 1    # user win
> 

Try adding into the first line of your win function:

        global uw, cw

Then Python knows to look outside your function to find those variables.

Lars
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to