Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from math import sqrt
- def eq_gr_2(a, b, c):
- delta = b ** 2 - 4 * a * c
- if (delta < 0):
- return "There is no solution!"
- if (delta == 0):
- return (-b + sqrt(delta)) / (2 * a)
- x1 = (-b + sqrt(delta)) / (2 * a)
- x2 = (-b - sqrt(delta)) / (2 * a)
- return x1, x2
- if __name__ == "__main__":
- a = int(input("a="))
- b = int(input("b="))
- c = int(input("c="))
- print("answer:", eq_gr_2(a, b, c))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement