Guest User

Untitled

a guest
Dec 16th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. # 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.
  2. a = 2
  3. b = -9
  4. c = -5
  5. temp = (b * b - 4 * a * c) ** 0.5
  6. solution1 = (-b + temp) / (2 * a)
  7. solution2 = (-b - temp) / (2 * a)
  8. print "First solution:", solution1
  9. print "Second solution:", solution2
Add Comment
Please, Sign In to add comment