if example with math
This commit is contained in:
parent
20e63ed496
commit
5ee4d38ff0
2 changed files with 12 additions and 0 deletions
12
if-example-math.py
Normal file
12
if-example-math.py
Normal file
|
@ -0,0 +1,12 @@
|
|||
import math
|
||||
a = float(input('a:'))
|
||||
b = float(input('b:'))
|
||||
c = float(input('c:'))
|
||||
|
||||
delta = b * b - 4 * a * c
|
||||
if delta < 0:
|
||||
print('Kök yok')
|
||||
else:
|
||||
x1 = (-b + math.sqrt(delta)) / (2 * a)
|
||||
x2 = (-b - math.sqrt(delta)) / (2 * a)
|
||||
print('x1 = {}, x2 = {}'.format(x1, x2))
|
Loading…
Reference in a new issue