1import random # Don't forget to install it first with pip install random
2
3ahahfunny = ['ahah ', 'copy-', 'paste ', 'stack overflow',' go ', 'brrr']
4# the biggest index in this list above is 5 (0 being 1 in programming)
5
6print(ahahfunny[random.randint(0, 5)] # I like this way,
7
8print(random.choice(ahahfunny)) # But this way is WAY thiccer...
1import random
2
3# with replacement = same item CAN be chosen more than once.
4# without replacement = same item CANNOT be chosen more then once.
5
6# Randomly select 2 elements from list without replacement and return a list
7random.sample(list_name, 2)
8
9# Randomly select 3 elements from list with replacement and return a list
10random.choices(set_name, k=3)
11
12# Returns 1 random element from list
13random.choice(list_name)