Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # The purpose of this script is to have an interactive script for soliving quadratic equations. The script will allow the user to enter a value for he variables a, b, and c. It will then check the discriminat and indicate where tehre is one, two, or no solution(s) as well as giving the solution.
- a = 2
- b = -9
- c = -5
- temp = (b * b - 4 * a * c) ** 0.5
- solution1 = (-b + temp) / (2 * a)
- solution2 = (-b - temp) / (2 * a)
- print "First solution:", solution1
- print "Second solution:", solution2
Add Comment
Please, Sign In to add comment