random choice from dictionary

sarah123ed at gmail.com sarah123ed at gmail.com
Mon Dec 24 00:12:07 EST 2018


Maybe something like this?

    import random
    k = list(data.keys())
    random.shuffle(k)
    selected = f[k[0]]


More information about the Python-list mailing list