randrange() Function

The randrange() function simply returns a random number with the range provided when the function is called. If one parameter is supplied, the random number generated will fall between 1 and that parameter. If two parameters are supplied, the random number will fall between the first and second parameter, both included.

We use the randrange() function in our Simon Says game to generate a random sequence of LED flashes for our game.