Python supports standard logical conditions:
a == b
a != b
a < b
a > b
a <= b
a >= b
Conditions are used in “if statements” and loops:
a = 33
b = 200
if b > a:
print("b is greater than a")
b is greater than a
a = 365
b = 365
if b > a:
print("b is greater than a")
elif a == b:
print("a and b are equal")
else:
print("a is greater than b")
a and b are equal
As shown above, Python relies on indentation to define scope in the code.
Use the Search Bar to find content on MarketingMind.
Contact | Privacy Statement | Disclaimer: Opinions and views expressed on www.ashokcharan.com are the author’s personal views, and do not represent the official views of the National University of Singapore (NUS) or the NUS Business School | © Copyright 2013-2025 www.ashokcharan.com. All Rights Reserved.