[Tutor] [Tutor} Why doesn't it choose a new number each time?
falcon3166 at hotmail.com
Thu Feb 15 09:42:06 CET 2007
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
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.
> 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...
More information about the Tutor