Splitting strings - for a calculation
<p>I want to create a calculator with several functions. When the user inputs something such as "ADD3, DIVIDE4" it will output the answer. So I believe I will have to split the string to work on each part individually. 
So far all I can find is</p>

<pre><code>    numb= input("What is your first numb")
    calc = input("What is your calculation")
    calc.split(', ')
</code></pre>

<p>But I don't know how to work on each section once it has been split.
So for example if the first is numb = 5 and then its 'calc = ADD3, SUB4' the program will output 4. But then so when it gets more complicated with more calculations and things like DIVIDE it will still work.
Thank you</p>

<p>Loop through calc Items. In the loop use a Switch case to find out the Operation and do the calculation. </p>

<p>edit: refer to this <a href="https://www.pydanny.com/why-doesnt-python-have-switch-case.html" rel="nofollow">link</a> for switch case implementation in python.</p>

python string split