how to use the random module with a list in python code example

Example 1: how to use random in python

import random
print(random.randint(3, 7)) #Prints a random number between 3 and 7
array = [cars, bananas, jet]
print(random.choice(array)) #Prints one of the values in the array at random

Example 2: how to call a random function in python

import random

my_list = [func_test_1, func_test_2, func_test_3]
random.choice(my_list)()

Example 3: which function to use in random module for a list in python

random.choice

Example 4: import os from random import randint

import os
from random import randint
def amazon_gc():
os.system("clear")
print("Amazon giftcard generator")
print("Stop this with ctrl+c")
print("Starting generating giftcards........")
try:
while 1 == 10:
char = [0,1,2,3,4,5,6,7,8,9,'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','V','W','X','Y','Z']
giftcard = (random.choice(char),random.choice(char),random.choice(char),
random.choice(char),random.choice(char),random.choice(char),
random.choice(char),random.choice(char),random.choice(char),
random.choice(char),random.choice(char),random.choice(char),
random.choice(char),random.choice(char),random.choice(char))
h = (''.join(map(str, giftcard[0:4])))
u = (''.join(map(str, giftcard[4:10])))
n = (''.join(map(str, giftcard[10:])))
print("==================================")
print("Amazon giftcard: ")
d = (h+'-'+u+'-'+n)
print(h+'-'+u+'-'+n)
print("==================================")
time.sleep(5)
except KeyboardInterrupt as e:
print("bye"