Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

quadratic equation python

print ("ax2 + bx + c = 0")
a = float(input("a: "))
b = float(input("b: "))
c = float(input("c: "))
delta = (b**2) - (4*a*c)
answers = []
numerator = [-b + delta**0.5, -b - delta**0.5]

denominator= 2 * a

for i in range(2):
    ans = numerator[i] / denominator
    answers.append(ans)
print (answers)
Source by treyhunner.com #
 
PREVIOUS NEXT
Tagged: #quadratic #equation #python
ADD COMMENT
Topic
Name
3+9 =