SyntaxFix
Write A Post
Hire A Developer
Questions
If you really just want a random value from the available key range, use random.choice on the dictionary's values (converted to list form, if Python 3).
random.choice
>>> from random import choice >>> d = {1: 'a', 2: 'b', 3: 'c'} >>>> choice(list(d.values()))