How to write a python computer program that will take any valid arithmetic expression as a string and will output a list (or array of string) of individual objects of the expression such as numbers, operators, variables, and parenthesis?
Example#1:
Input:
x + 2
Output:
["x", "+", "2"]
Example#2:
Input:
2 * count + 17
Output:
["2", "*", "count", "+", "17"]
Example#3:
Input:
(12+x1)*(y2-15)
Output:
["(", "12", "+", "x1", ")", "*", "(", "y2", "-", "15", ")"]