title: How to perform math operation on numbers in string of python
body: <p>How we can perform mathematical operation on string in python.</p>
  
  <p>Consider below example</p>
  
  <pre><code>with open('/home/akashk/projects/math.txt') as f:
      content = f.readlines()
  content = [x.strip() for x in content] 
  
  for x in content:
      print(x)
      print(type(x))
  </code></pre>
  
  <p>output is like </p>
  
  <pre><code>1abc0+5*1hv0
  </code></pre>
  
  <p></p>
  
  <p>I want to perform operation using operand and operators</p>
  
  <p>above should be considered as 10+5*10 = 60
  In short remove characters and perform mathematical operation on operands.</p>
  
  <p>eval('10+5*10') which gives 60 but it will not handle characters. </p>