i want to separate the numbers and operator in string how can i do it ?
I am using split and getting numbers but i am not able to get the operator This code only works when operator is '+' otherwise it gives an error!
T = "123+456"
op = '+' or '-'
for i in range(T):
n = input()
n1,n2 = n.split(op)
print(n1)
print(n2)