Kamus acak Python
dict = { 'A' : 1, 'A' : 2, 'A' : 3}
random_element = random.choice(list(dict.items())
# Output = (key, value)
Witty Weasel
dict = { 'A' : 1, 'A' : 2, 'A' : 3}
random_element = random.choice(list(dict.items())
# Output = (key, value)
random_entry = random.choice(entry_list)
random.choice(list(my_dict))
entry_list = list(a_dict.items())
print(random_entry)
('b', 2)