[Tutor] [Tutor} Why doesn't it choose a new number each time?

Nathan Pinno falcon3166 at hotmail.com
Thu Feb 15 09:42:06 CET 2007


Hey all,
 
I edited my code, and it seems to choose a new number each time. Maybe I didn't run my test long enough the first time?
 
I should have spotted the problem of
 
choice(range(3))
 
a mile away. I edited that bit, and now I think it's running right. (25 rounds of Rock, Paper, Scissors should be good enough testing, right? LOL) The new code is
 
choice(range(1,4))and that was a suggestion. (Thanks!) But can anyone explain why I can shorten the code? I looked at it a long while yesterday, and came up with nothing. The only thing I decided was to try to get it to the GUI stage.
 
Thanks,
Nathan
> Date: Wed, 14 Feb 2007 17:17:57 +0100> From: "Rikard Bosnjakovic" <rikard.bosnjakovic at gmail.com>> Subject: Re: [Tutor] Why doesn't it choose a new number each time?> To: tutor at python.org> Message-ID:> <d9e88eaf0702140817s7e7ab8a0n44c8cd2e0e56d281 at mail.gmail.com>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed> > On 2/14/07, Alan Gauld <alan.gauld at btinternet.com> wrote:> > > I don't think that's a problem. The fact that the computers numbers> > don't correspond with the users numbers shouldn't matter provided> > the 'if' tests align with the choice result, which they do.> > Alan,> > You're right, ofcourse. I approached the problem entirely> pragmatically and somehow disregarded the original problem.> > Nathan, you need to provide us more details. For example, what really> happens (which you consider being a problem), and what do you want to> happen instead?> > > --> - Rikard.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070215/6a6169d7/attachment.html 


More information about the Tutor mailing list