Skip to content

Commit 03e3a21

Browse files
Fix linting issues
1 parent 8c61a7d commit 03e3a21

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Math/quadratic_equation_solver.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import cmath
22

3+
34
def solve_quadratic(a, b, c):
45
if a == 0:
56
raise ValueError("Coefficient 'a' must be non-zero for a quadratic equation.")
@@ -8,14 +9,15 @@ def solve_quadratic(a, b, c):
89

910
root1 = (-b + cmath.sqrt(discriminant)) / (2 * a)
1011
root2 = (-b - cmath.sqrt(discriminant)) / (2 * a)
11-
12+
1213
return root1, root2
1314

15+
1416
try:
1517
a = float(input("Enter coefficient a: "))
1618
b = float(input("Enter coefficient b: "))
1719
c = float(input("Enter coefficient c: "))
18-
20+
1921
roots = solve_quadratic(a, b, c)
2022
print(f"The roots of the equation are: {roots[0]} and {roots[1]}")
2123
except ValueError as e:

0 commit comments

Comments
 (0)