IDLE 2.6.4
>>> exp = "1+2"
>>> exp
'1+2'
>>> string1 = exp.split("+")
>>> string1
['1', '2']
>>> print "Operator 1 is : " , op1
Operator 1 is :
Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
print "Operator 1 is : " , op1
NameError: name 'op1' is not defined
#just to get and error message "NameError" because we have nor defiend op1.
>>> print "Operator 1 is: %s " % string1[0]
Operator 1 is: 1

So the finish script.

def start():
exp = "1+2"
string1 = exp.split("+")
print "Operator 1 is: %s" % string1[0]
print "Operator 2 is: %s" % string1[1]
start()
'''Out-->
Operator 1 is: 1
Operator 2 is: 2
'''

The next step is to use regular expressions (learn the re module)

import re
pat = re.compile(r"([+\-*/=]+)")
print(pat.split("1+2-3")) # prints ['1', '+', '2', '-', '3']
pat = re.compile(r"[+\-*/=]+")
print(pat.split("1+2-3")) # prints ['1', '2', '3']

If regular expressions are not sufficient, the next step is to use a parser like wisent (learn grammars and parsing computer languages).

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...

Hi. so this is actually a continuation from another question of mineHere but i was advised to start a new thread as the original question was already answered.

This is the result of previous question answered :

Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.