(Python) Can I store the functions themselves, but not their value, in a list
<p>As you can see from the code below, I'm adding a series of functions to a list.
The result is that each function gets ran and the returned value is added to the list. </p>

<pre><code>foo_list = []
foo_list.append(bar.func1(100))
foo_list.append(bar.func2([7,7,7,9]))
foo_list.append(bar.func3(r'C:\Users\user\desktop\output'))
</code></pre>

<p>What I would like to know is, is it possible to have the function stored in the list and then ran when it is iterated upon in a for loop?</p>

<p><a href="https://i.stack.imgur.com/MS9ml.png" rel="nofollow"><img src="https://i.stack.imgur.com/MS9ml.png" alt="enter image description here"></a></p>

<p>Yeah just use lambda:</p>

<pre><code>foo_list = []
foo_list.append(lambda: bar.func1(100))
foo_list.append(lambda: bar.func2([7,7,7,9]))
foo_list.append(lambda: bar.func3(r'C:\Users\user\desktop\output'))

for foo in foo_list:
    print(foo())
</code></pre>

python list