Untitled
unknown
plain_text
a year ago
964 B
6
Indexable
#print('hello')
x = float(input('podaj wartosc x '))
# x - int(input("podaj wartosc x"))"text" i 'tekst' to
# zmnienna typu string ("" i '' to to samo)
if x < 0:
x = -x
#else:
# y=x
print('wynik to', x)
#print('|', x, '|=', y) #jedna wersja
#print('|{}|={}'.format(x,y)) #druga wersja
#print('|%d|-%d'%(x,y)) #trzecia wersja
#zad1
#x = float(input('podaj wartosc x '))
#x = x%2
#if x == 0:
# print('liczba jest parzysta')
#else:
##elif x == 1:
# print('liczba jest nieparzysta')
import math
a=float(input('podaj ws. A'))
b=float(input('podaj ws. B'))
c=float(input('podaj ws. C'))
delta=b**2 - 4*a*c
if a==0:
if delta>0:
x=(-b-math.sqrt(delta))/(2*a)
y=(-b+math.sqrt(delta))/(2*a)
print('wynik to', x)
print('wynik to', y)
elif delta<0:
x=(-b)/(2*a)
print('wynik to', x)
else:
print('brak rozwiazan')Editor is loading...
Leave a Comment