how to use random library in python code example Example 1: how to import random in python import random Example 2: which function to use in random module for a list in python random.choice