How to change priority in math order(asterisk)
<p>I want users to input math formula in my system. How can convert case1 formula to case2 formula using Python? In another word, I would like to change math order specifically for double asterisks.</p>

<pre><code>#case1
3*2**3**2*5
&gt;&gt;&gt;7680

#case2
3*(2**3)**2*5
&gt;&gt;&gt;960
</code></pre>

<p>Not only is this not something that Python supports, but really, why would you want to? Modifying BIDMAS or PEMDAS (depending on your location), would not only give you incorrect answers, but also confuse the hell out of any devs looking at the code.</p>

<p>Just use brackets like in Case 2, it's what they're for.</p>

python python-2.7 numpy math