Python has a library of functions that enable you to generate all sorts of random numbers.

The first thing you will need to do, is import the Random library, thus:

import random

To use the functions from the random library, you do so by calling the functions as a sub-property of random, with any required arguments specified in the parenthesis thusly:

random.subproperty(arument1, argument2)

Generate a random integer

random.randint(arg1, arg2)

Returns a random integer between the specified integers, where arg1 and arg2 are variables containing the low and high and low bounds.:

>>>import random
>>>random.randint(1,100)
95
>>>random.randint(1,100)
49

Choose a random element from a list or container

random.choice(container)

Returns a randomly selected element from a non-empty sequence (indicated here by the argument container):

>>>import random
>>>random.choice('computer')
't'
>>>random.choice([12,23,45,67,65,43])
45
>>>random.choice((12,23,45,67,65,43))
67

Randomly shuffle a list

random.shuffle(my_list)

This functions randomly reorders the elements in a list - indicated here with the argument, my_list.

>>>numbers=[12,23,45,67,65,43]
>>>random.shuffle(numbers)
>>>numbers
[23, 12, 43, 65, 67, 45]
>>>letters = ['w', 'o', 'r', 'd']
>>>random.shuffle(letters)
>>>letters
['o', 'w', 'r', 'd']