Advertisement
Guest User

ERROR, Second degree resolver

a guest
Sep 13th, 2016
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. from math import sqrt
  2.  
  3.  
  4. a = int(input("a"))
  5. b = int(input("b"))
  6. c = int(input("c"))
  7.  
  8.  
  9. print(a,"x²+",b,"x+",c,"=0")
  10.  
  11. d = int((b**)-4*a*c)
  12.  
  13. if d < 0:
  14.     print("Pas de racines")
  15.  
  16. if d == 0:
  17.     print("Une racine: ",(-b)/2*a)
  18.  
  19. if d > 0:
  20.     x1 = (-b-sqrt(d))/2*a
  21.     x2 = (-b+sqrt(d))/2*a
  22.     print("Deux racines: x1= ",x1," et x2 = ",x2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement