This line is responsible for probelm
(-b+math.sqrt(b**2-4*a*c))/2*a
You actually need to add more parentheses. Just change x/2*a into (x/2)*2
(-b + math.sqrt(b**2 - 4*a*c)) / (2 * a)
Additionally, in case you're as of now storing d, why not use it?
x = (-b + math.sqrt(d)) / (2 * a)
Improve your knowledge in Python from scratch using python online courses
To know more about this you can have a look at the following video tutorial:-