Monday, March 18, 2013

It's a thing

Somebody on Twitter reminded me of this when he mentioned using Excel as a random number generator.  Here's an alternative from the world of Python. It of course assumes Python is installed and that the interpreter is in the command path.

c:/ > Python

Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.

>> import random as r

>> r.randrange(25)



Replace the "25" with whatever range you want. 

It takes all of 20 seconds once you get the hang of it, no saved shortcuts required. Other than the shell, which any good geek will have on the desktop.

You can also specify the lower bounds of the range.

>> r.randrange(3,7)


You can also do a thing with a list of items, but who needs all that typing?

No comments:

Post a Comment