字典随机数获取 c={'a':1,'b':2} print(random.sample(c.keys(),1)) print(c[random.sample(c.keys(),1)[0]]) 刘欢原创2022/8/12python字典小于 1 分钟