| [ Web Proxy ] |
| Viewing: https://raw.githubusercontent.com/umangsingh9987/pythonprogram/patch-2/Quadratic%20formula | [Back] [Original] |
import cmath
print('Solve the quadratic equation: ax**2 + bx + c = 0')
a = float(input('Please enter a : '))
b = float(input('Please enter b : '))
c = float(input('Please enter c : '))
delta = (b**2) - (4*a*c)
solution1 = (-b-cmath.sqrt(delta))/(2*a)
solution2 = (-b+cmath.sqrt(delta))/(2*a)
print('The solutions are {0} and {1}'.format(solution1,solution2))
| Web Proxy Viewer | New URL | Original Page |