File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11CHANGELOG
22=========
33
4+ [0.1.1]-2023-05-04
5+ -------------------
6+
7+ - Add quadratic-equation
8+
49[0.1.0]-2023-05-03
510-------------------
611
@@ -10,25 +15,3 @@ CHANGELOG
1015 - hex-to-digit
1116 - addition-quiz
1217 - palindrome
13-
14-
15-
16-
17-
18-
19-
20-
21-
22-
23-
24-
25-
26-
27-
28-
29-
30-
31-
32-
33-
34-
Original file line number Diff line number Diff line change @@ -13,3 +13,4 @@ This collection of small Python programs wants to help beginners in this way. De
1313* hex-to-digit
1414* addition-quiz
1515* palindrome
16+ * quadratic-equation
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+
3+ """
4+ Quadratic Equation
5+ Version: 1.0
6+ Python 3.11
7+ Date created: May 4th, 2023
8+ Date modified: -
9+ """
10+
11+ import math
12+
13+
14+ def quadratic_formula (a , b , c ):
15+
16+ x1 = (- b - math .sqrt (b * b - 4 * a * c )) / (2 * a )
17+ x2 = - b / a - x1
18+
19+ return (x1 , x2 )
20+
21+
22+ if __name__ == '__main__' :
23+ result = quadratic_formula (2 , - 8 , 6 )
24+ print (result )
You can’t perform that action at this time.
0 commit comments