Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to shuffle dictionary python

import random

d = {'a':1, 'b':2, 'c':3, 'd':4}
l = list(d.items())
random.shuffle(l)
d = dict(l)
 
PREVIOUS NEXT
Tagged: #shuffle #dictionary #python
ADD COMMENT
Topic
Name
8+9 =