fork(1) download
  1. from random import*
  2. def f(d,o={}):
  3. i=list(d.values());shuffle(i)
  4. for k in d.keys():o[k]=i.pop()
  5. return o
  6.  
  7. for i in range(5):
  8. print(f({4:4,5:5,6:6}))
Success #stdin #stdout 0.01s 12368KB
stdin
Standard input is empty
stdout
{4: 6, 5: 5, 6: 4}
{4: 6, 5: 5, 6: 4}
{4: 4, 5: 6, 6: 5}
{4: 5, 5: 4, 6: 6}
{4: 4, 5: 6, 6: 5}