-1
enter code here
import math
print("\nax^2+bx+c\n")
A=float(input("a: "))
B=float(input("b: "))
C=float(input("c: "))

d=math.sqrt((B**2)-4(A)(C))
answerA=(-B-d)/2*A

answerB=(-B+d)/2*A

print("the answers are ",answerA,"and",answerB)

I dont really understand what is happening, here is an image of the error enter image description here

main.py:7: SyntaxWarning: 'int' object is not callable; perhaps you missed a comma? d=math.sqrt((B**2)-4(A)(C))

1 Answers1

3

You have to be explicit with the multiplication signs.

import math
print("\nax^2+bx+c\n")
A=float(input("a: "))
B=float(input("b: "))
C=float(input("c: "))

d=math.sqrt((B**2)-4*A*C)
answerA=(-B-d)/2*A

answerB=(-B+d)/2*A

print("the answers are ",answerA,"and",answerB)
Pranav Hosangadi
  • 23,755
  • 7
  • 44
  • 70
Matteo Zanoni
  • 3,429
  • 9
  • 27