The Python Oracle

How to get a random value from dictionary?

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Isolated

--

Chapters
00:00 Question
00:29 Accepted answer (Score 366)
00:54 Answer 2 (Score 19)
01:13 Answer 3 (Score 12)
01:55 Answer 4 (Score 11)
02:10 Thank you

--

Full question
https://stackoverflow.com/questions/4859...

Answer 1 links:
https://github.com/robtandy/randomdict

Answer 2 links:
[popitem()]: http://docs.python.org/2/library/stdtype...
[doesn't preserve order]: https://stackoverflow.com/a/526131
[docs]: http://docs.python.org/2/library/stdtype...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #random #dictionary #key

#avk47