Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Basic algebra in Python
#11
So it turns out that the problem was due to me using PyCharm and having it set to run the wrong python file, an older one that returns the error I have been getting. Now it is giving me the [5/2] that everyone else has been getting. So now that the error has been resolved, how do I get it to output in decimal?

UPDATE:
I got it to work with this code:
from sympy import *
x = Symbol('x')
outputvar = solve(x*2 - 200, x)
print float(outputvar[0])
If this code is not ideal please let me know.
Thank you all for your help!
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020