How to run functions in random order?
<p>I want to run functions with random order. It looks like "shuffle" function which shuffle a variables list.</p>

<p>Input:</p>

<pre><code>def a():
    print('a')

def b():
    print('b')

def c():
    print('c')

shuffle([a,b,c])
</code></pre>

<p>This is output what I want:</p>

<pre><code>a
b
c
</code></pre>

<p>or</p>

<pre><code>a
c
b
</code></pre>

<p>or </p>

<pre><code>c
b
a
</code></pre>

<p>or etc
How to run functions with random order?</p>

<pre><code>import random

def a():
    print('a')

def b():
    print('b')

def c():
    print('c')

# map the inputs to the function blocks
options = {0 : a,
           1 : b,
           2 : c,
}
num = random.randint(0, 2)
options[num]()
</code></pre>

<p>That's a simple way to randomly choose the functions</p>

python function python-3.x random