if example with math

This commit is contained in:
Mert Gör 🇹🇷 2023-05-20 06:13:42 +03:00
parent 20e63ed496
commit 5ee4d38ff0
No known key found for this signature in database
GPG Key ID: 2100A876D55B39B9
2 changed files with 12 additions and 0 deletions

12
if-example-math.py Normal file
View 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))

View File