`random.choice(list({'a': 1, 'b': 2}))` → `'b'` @cᴏʟᴅsᴘᴇᴇᴅ your code will work until Python 3.5.
– Klaus D.Mar 21 '18 at 16:15
@cᴏʟᴅsᴘᴇᴇᴅ even though dicts are not ordered in earlier python versions, the order is far from random, so I would not advocate that
– Chris_RandsMar 21 '18 at 16:16