Answers for "TypeError: Population must be a sequence or set. For dicts, use list(d)."

0

TypeError: Population must be a sequence or set. For dicts, use list(d).

d = {'a':1,'b':2}
random.sample(list(d), 1)
Posted by: Guest on May-29-2020

Code answers related to "TypeError: Population must be a sequence or set. For dicts, use list(d)."

Python Answers by Framework

Browse Popular Code Answers by Language