[Tutor] how come this doesnt work

Noah Hall enalicho at gmail.com
Sat Jan 15 04:06:47 CET 2011


Adding reply to list -

On Sat, Jan 15, 2011 at 2:55 AM, walter weston <hacker0100 at hotmail.com> wrote:
> I only want to generate a random number once
>

Then you don't need a for loop. Think of a for loop as something you
need when you want to run a piece of code several times, for example

for x in range(1,6):
   print('This is message number %d' % (x))

HTH


More information about the Tutor mailing list