Showing input prompt in python
I am using IDLE for Python on a Mac OS. I wrote the following in a .py file:
import math
def main():
print "This program finds the real solution to a quadratic"
print
a, b, c = input("Please enter the coefficients (a, b, c): ")
discRoot = math.sqrt(b * b-4 * a * c)
root1 = (-b + discRoot) / (2 * a)
root2 = (-b - discRoot) / (2 * a)
print
print "The solutions are: ", root1, root2
main()
IDLE now permanently displays:
This program finds the real solution to a quadratic
Please enter the coefficients (a, b, c):
When I enter 3 numbers (ex: 1,2,3) IDLE does nothing. When I hit enter
IDLE crashes (no crash report).
I quit and restarted but IDLE is now permanemtly displaying the above and
won't respond to other files.
No comments:
Post a Comment