lundi 10 octobre 2016

Python 3: How to run functions with random order?

I want to run functions with random order. It looks like "shuffle" function which shuffle a variables list.

Input:

def a():
    print('a')

def b():
    print('b')

def c():
    print('c')

shuffle([a,b,c])

Output 1:

a
b
c

or

a
c
b

or

c
b
a

or etc How to run functions with random order ? Thank you very much :)




Aucun commentaire:

Enregistrer un commentaire