Random number challenge

Jake Pollmann jake.pollmann at gmail.com
Wed Jun 11 20:30:27 MDT 2008


On Wed, Jun 11, 2008 at 7:54 PM, Andrew Jorgensen
<andrew at jorgensenfamily.us> wrote:
> This comes up every month at PLUG (for door prizes) so I thought I'd ask here.  What's an
> easy to remember way to generate a random number between 1 and some given number.

Here is a two liner in the Python shell...

import random
random.randint(1,100)

The real programmers on the list will probably point out that this
isn't really random or show a way to cut 4 keystrokes out, but it
might meet the original requirements above.


JP



More information about the PLUG mailing list