0
Invalid syntax in square equation
Please help me, I can't find a mistake. The console says there's a mistake in x2, but I can't understand where exactly. https://code.sololearn.com/cKROc6w2NaHD/?ref=app
4 Réponses
+ 5
from math import sqrt
a = int(input())
b = int(input())
c = int(input())
D = (b ** 2) - (4*a*c)
if D == 0:
print(-(b / (2*a)))
elif D > 0:
x1 = -((b - sqrt(D)) / (a*2))
x2 = -((b + sqrt(D)) / (a*2))
print(x1, x2)
+ 4
The keyword 'continue' is only used in loops to skip to the next iteration. You might have been looking for the keyword 'pass'.
+ 3
Your x1 = ... and x2 = ... lines are missing a close-parenthesis ‘)’ at the end of each line.
+ 2
thank all of you, dear friends, now it works:)