The random
module has a function that shuffles in-place.
So we can get the dict's values, shuffle them, and construct a new dict.
Demo:
>>> import random
>>> d = {
... "a": "ACAT",
... "b": "ACTG",
... "c": "ACCC"
... }
>>> shuffled = list(d.values())
>>> random.shuffle(shuffled)
>>> dict(zip(d, shuffled))
{'a': 'ACCC', 'b': 'ACTG', 'c': 'ACAT'}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…