Use the random.choice() function

#import the random module
import random

#The list to choose from
L = ['Python', 'C++', 'Swift', 'Ruby', 'PHP', 'C#']

#Choose a random value from the list
print(random.choice(L))

The choice() function in the random  module is used to randomly select an item from a sequence such as a list, tuple, string, range e.t.c.

choice(seq)
seq Required. The sequence containing the elements to choose from. 

The function randomly picks an element from the sequence and returns it. Please note that sets and dictionaries are not sequences since the items are unordered, they, therefore, cannot be used as arguments to the choice() function, doing so will raise a TypeError.

Use the choice function to get a random integer in a range

#import the random module
import random

#Select an inteher from a range
print(random.choice(range(20)))

Get a random element from a list

#import the random module
import random

#The list to choose from
L = ['Python', 'C++', 'Swift', 'Ruby', 'PHP', 'C#']

#Choose a random value from the list
print(random.choice(L))

Get a random item from a tuple

#import the random module
import random

#The list to choose from
my_tuple = ((1, 2, 3), (4, 5, 6), (7, 8, 9))

#Choose a random value from the list
print(random.choice(my_tuple))