For some reason my script refuses to run directly from Text Wrangler but works fine when imported into terminal.
import math
def main():
print("This program find the real solutions to a quadratic\n")
a,b,c, = eval(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("\nThe solutions are:" , root1, root2)
main()
When I run that in textwrangler, I get the error message "TypeError: eval() arg 1 must be a string or code object". Isn't the point of using eval() to imply that the following input is an integer and not a string? Why is this happening?