How to make user choose his own function
<p>I am currently studying programming and I have the following problem.</p>

<p>A user should enter the operation that he wants to do from the command line and according to the operation, he should enter the information about the item.</p>

<p>I have tried things like the following:</p>

<pre><code>def stock(f):
    d={}
    f()
    return d


def add(item,amount):
    d[item]=amount
    return d
</code></pre>

<p>Or</p>

<pre><code>def stock(item,amount,f):
    d={}
    if f():
        d[item]=amount
    return d


def add():
    return True
</code></pre>

<p>and, second one doesn't work for me because, when i want to use this code remove(a,b) i don't need three argument. What i'm trying to say is number of argument changes according to my operations. How do i handle this.</p>
