33 lines
489 B
Python
33 lines
489 B
Python
|
|
program01 = '''
|
|
|
|
Program: if01
|
|
This program demonstrates the conditional tests used in Python.
|
|
|
|
'''
|
|
|
|
print(program01)
|
|
|
|
a = 4
|
|
b = 7
|
|
c = 7
|
|
|
|
print(f"a = {a}\nb = {b}\nc = {c}\n")
|
|
|
|
print(f"a == b {a==b}")
|
|
print(f"a != b {a!=b}")
|
|
print(f"a < b {a<b}")
|
|
print(f"a <= b {a<=b}")
|
|
print(f"a > b {a>b}")
|
|
print(f"a >= b {a>=b}")
|
|
|
|
print("\n")
|
|
|
|
print(f"c == b {c==b}")
|
|
print(f"c != b {c!=b}")
|
|
print(f"c < b {c<b}")
|
|
print(f"c <= b {c<=b}")
|
|
print(f"c > b {c>b}")
|
|
print(f"c >= b {c>=b}")
|
|
|