If, elif and else
a = 33
b = 33
if b > a:
print("b is greater than a")
elif a == b:
print("a and b are equal")
c = 33
d = 44
if c > d:
print("c is greater than d")
elif c < d:
print("c is smaller than d")
else:
print("c is equal to d")
e = 22
f = 33
if e > f:
print("e is greater than f")
elif e < f:
print("e is smaller than f")
else:
print("e and f are equal")
g = 22.0
h = 22
if g == h:
print("g and h are equal")
elif g < h:
print("g is smaller than h")
else:
print("g is greater than h")
a = 22.00050
h = 22.000500
if a == h:
print("a and h are equal")
elif a > h:
print("a is greater than h")
else:
print("a is smaller than h")
b = 22.005
c = 22.0050
if b > c:
print("b is greater than c")
elif b == c:
print("b and c are equal")
else:
print("b is smaller than c")
h = 22.999
i = 22.9990
if h > i:
print("h is greater than i")
elif h < i:
print("h is smaller than i")
else:
print("h and i are equal")
e = 99.8888
f = 99.88880000
if e > f:
print("e is greater than f")
elif e < f:
print("e is smaller than f")
else:
print("e and fare equal")
i = 22.9999
j = 22.99990000
if i < j:
print("i and j are equal")
elif i > j:
print("i is greater than j")
else:
print("i and j are equal")
a = 99.99999
b = 99.999999
if a < b:
print("a is smaller than b")
elif a > b:
print("a is greater than b")
else:
print("a and b are equal")
c = 20.8888
d = 20.8888000000000000000
if c > d:
print("c is greater than d")
elif c < d:
print("c is smaller than d")
else:
print("c and d are equal")
Comments
Post a Comment