Adatvizsgálatok

LEHETSÉGES FELTÉTELEK KIALAKÍTÁSA
a>b
c<b
a==b
a!=b
(a<0) or (a>10)
(a>5) and (a<10)
True and True (Eredmény: True)
False or True (Eredmény: True)

 

ADATVIZSGÁLAT1
a = 200
b = 33
if b > a:
print("b nagyobb a")
else:
print("b nem nagyobb a")
ADATVIZSGÁLAT2
a = 200
b = 33
if b > a:
print("b nagyobb a")
elif a == b:
print("a és b azonos")
else:
print("a nagyobb b")
ADATVIZSGÁLAT3 (Zárt tartomány)
a = int(input(’kérek egy számot:’ )
if a > 9 and a<100:
print(’A szám kétjegyű’)
ADATVIZSGÁLAT4 (Nyílt tartomány)
a = int(input(’kérek egy évszámot:’ )
if a <1949 or a>1945:
print(’Az esemény nem a második világháborúban történt’)

ADATVIZSGÁLAT5 (in operátor)
animals = ["dog", "lion", "cat"]
if "lion" in animals:
print('Yes lion')
if 'tiger' not in animals:
print('No tiger')


l

x

Website templates by JustDreamweaver.com