Логічні оператори or and not
Оберіть значення, що виведеться на екран після виконання наступних прикладів?
1)
a = True
b = True
c = True
d = False
s = (a and b) or c or d
print (s)
True
False
2)
a = False
b = False
c = True
d = False
s = (a or b) and (c or d)
print (s)
True
False
3)
x = 5
y = 5
z = (x <= 5.0) or (y == 4) and (x - y == 0)
print(z)
True
False
4)
site = 'Vitali4.com.ua'
checksite = site in 'vitali4.kl.com.ua' or site in 'Vitali4.kl.com.ua' or site in 'VITALI4.COM.UA'
print(checksite)
True
False
5)
x = int(input("введіть х"))
y = int(input("введіть y"))
print((x + y)**2 == x**2 + 2*x*y + y**2))
True
False
6)
a = 3
b = 5
c = 4
print('трикутник прямокутний -', b**2 == a**2 + c **2)
трикутник прямокутний - True
трикутник прямокутний - False