1. Get the key corresponding to the largest value in the dictionary
key = max(my_dict, key=my_dict.get)
example
2. Randomly select an element from a list or dictionary
import random
2.1 Randomly select an element from the list
random_value = random.choice(my_list)
2.2 Randomly select the key or value of an element from the dictionary
random_key = random.choice( list( my_dict.keys() ) )
random_value = random.choice( list( my_dict.values() ) )
Three, according to the dictionary value to find the corresponding key
key_list = list( filter(lambda key:my_dict[key] == value, my_dict) )
Fourth, delete a key-value pair in the dictionary
my_dict = my_dict.pop(key)
Continue to accumulate...