FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pythonprogram/Quadratic formula at master · deepcodespythonmorethenu/pythonprogram · GitHub
deepcodespythonmorethenu
pythonprogram
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
pythonprogram
/
Quadratic formula
Copy path
More file actions
More file actions
Latest commit
History
History
History
11 lines (9 loc) · 361 Bytes
Breadcrumbs
pythonprogram
/
Quadratic formula
Copy path
File metadata and controls
11 lines (9 loc) · 361 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
import cmath
print('Solve the quadratic equation: ax**2 + bx + c = 0')
a = float(input('Please enter a : '))
b = float(input('Please enter b : '))
c = float(input('Please enter c : '))
delta = (b**2) - (4*a*c)
solution1 = (-b-cmath.sqrt(delta))/(2*a)
solution2 = (-b+cmath.sqrt(delta))/(2*a)
print('The solutions are {0} and {1}'.format(solution1,solution2))
Back
|
FazBrowse Home
|
New Git URL