PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Made by Akshay Panwar
'''let us consider an equation ax**2+bx+c=0 where all a,b,c are real numbers'''
'''so here we will find the solutions of such equation '''
from math import *
a=float(input())
b=float(input())
c=float(input())
if pow(b,2)<4*a*c :
print("the equation has no real root ")
else:
D=sqrt(pow(b,2)-4*a*c)
x1=D-b/(2*a)
x2=-(D+b)/(2*a)
if D!=0 :
print("the solutions of the equation are", x1, "and" ,x2,)
else:
print("the equation has equal roots that is only one solution",x1 )
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run