
PRO
Danielle
asked

Expert
Abhay Jajodia answered
Hello Danielle, really nice question.
Any time you use a comparison in Python — things like ==, >, <, >=, and so on — Python evaluates that expression and decides whether it’s true or false. The result of that decision is always a Boolean value: True or False.
For example:
total = 150
result = total > 100
print(result) # True
Here Python checks the comparison, finds that 150 really is greater than 100, and gives you True. If the comparison wasn’t correct, you’d get False instead.
That’s just how comparisons work in Python:
they always produce a Boolean value.
If you have further questions, I'm here to help.
Python
This question was asked as part of the Getting started with Python course.
Our Experts
Sudip BhandariHead of Growth/Marketing
Apekchhya ShresthaSenior Product Manager
Kelish RaiTechnical Content Writer
Abhilekh GautamSystem Engineer
Palistha SinghTechnical Content Writer
Sarthak BaralSenior Content Editor
Saujanya Poudel
Abhay Jajodia
Nisha SharmaTechnical Content Writer
Udayan ShakyaTechnical Content Writer