Jul 19, 2021
Compare Variables
Python Programming 1036 views
#!/usr/bin/evn python
# Assign values in two variables
a, b = 5, 2
# If codition
if a > b:
# {} use to print value
print("A {} is greater than B {}".format(a,b))
# Else codition
else:
# {} use to print value
print("A {} is less than B {}".format(a,b))
# Conditional statement
print("A" if a < b else "B")
#***** Output *****
# A 5 is less than B 2
# B
Copy Code