📜  在 dict python 代码示例中选择随机条目

📅  最后修改于: 2022-03-11 14:45:25.645000             🧑  作者: Mango

代码示例1
from random import choice

dictionary[choice(list(dictionary.keys()))] # where "dictionary" is the label of, guess what, the variable holding a dictionary you want a random item from.