The asker commented:
I figure that if I understand a problem well enough to write a program that can figure it out, I don't need to do the work manually.
If he's writing a math expression solver as a learning exercise, using eval()
isn't going to help. Plus it's terrible design.
You might consider making a calculator using Reverse Polish Notation instead of standard math notation. It simplifies the parsing considerably. It would still be a good exercise