Diccionario de elección aleatoria Python
deck = {
'King':10,
'Queen':10,
'Valete':10}
random.choice(list(deck.keys()))
Happy Horse
deck = {
'King':10,
'Queen':10,
'Valete':10}
random.choice(list(deck.keys()))
dict = { 'A' : 1, 'A' : 2, 'A' : 3}
random_element = random.choice(list(dict.items())
# Output = (key, value)
random.choice(list(my_dict))
entry_list = list(a_dict.items())
print(random_entry)