illiers
wrote:
From: Bruno Desthuilliers
Subject: Re: UnboundLocalError - (code is short & simple)
To: python-list@python.org
Date: Monday, September 28, 2009, 8:24 AM
Chris Rebert a écrit :
> On Sun, Sep 27, 2009 at 8:5
rtin
--- On Mon, 9/28/09, Chris Kaynor wrote:
From: Chris Kaynor
Subject: Re: UnboundLocalError - (code is short & simple)
To: python-list@python.org
Date: Monday, September 28, 2009, 4:00 PM
On Sun, Sep 27, 2009 at 10:39 PM, New User wrote:
Hi Chris,
Thank you for the reply and info!
on the python list - I just forgot to remove you
from it (I used G-Mail's reply all). In general, unless the reply is
off-topic or personal, it should be replied to on-list. This allows more
people to both see the answer and to help further explain the answer.
>
> --- On *Mon, 9/28/09, Chris Ka
On Sep 28, 6:07 am, pylearner wrote:
> System Specs:
>
> Python version = 2.6.1
> IDLE
> Computer = Win-XP, SP2 (current with all windows updates)
>
> ----
>
> Greetings:
>
> I have written code for two things: 1
Chris Rebert a écrit :
On Sun, Sep 27, 2009 at 8:53 PM, pylearner wrote:
---
Traceback (most recent call last):
File "", line 1, in
toss_winner()
File "C:/Python26/toss_winner.py", line 7, in toss_winner
coin_toss = coin
On Sun, Sep 27, 2009 at 8:53 PM, pylearner wrote:
> ---
>
> Traceback (most recent call last):
> File "", line 1, in
> toss_winner()
> File "C:/Python26/toss_winner.py", line 7, in toss_winner
> coin_toss = coin_toss()
> Unb
Lets look at what is happening on a few of the lines here:
First:
from coin_toss import coin_toss
imports the module coin_toss and sets the local variable coin_toss to the
value of coin_toss in the module coin_toss.
Second:
coin_toss = coin_toss()
calls the function bound to the name coin_toss
System Specs:
Python version = 2.6.1
IDLE
Computer = Win-XP, SP2 (current with all windows updates)
Greetings:
I have written code for two things: 1) simulate a coin toss, and 2)
assign the toss result to
Python version = 2.6.1
IDLE
Computer = Win-XP, SP2 (current with all windows updates)
---
Greetings:
I have written code for two things: 1) simulate a coin toss, and 2)
assign the toss result to a winner. Code for the simulated coin t