Let's say I have an equation:
2x + 6 = 12
With algebra we can see that x = 3
. How can I make a program in Python that can solve for x
? I'm new to programming, and I looked at eval()
and exec()
but I can't figure out how to make them do what I want. I do not want to use external libraries (e.g. SAGE), I want to do this in just plain Python.