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>

<p>Here is how I would do. Basically what <strong>thefourtheye</strong> has suggested. <a href="https://repl.it/DsMk/0" rel="nofollow">Run this Code</a></p>

<pre><code>from random import shuffle

def a():
    print('a')

def b():
    print('b')

def c():
    print('c')

def main():
    lis = [a,b,c]

    shuffle(lis)

    for i in lis:
        i()
</code></pre>

python function python-3.x random