educative.io

Educative

Doubt in boolean expression

Actually I dint understand booleans exactly , and even when I tried learning it in my computer with the same format , the programme did not run , it showed an error . I hope you will clear my doubt , by giving some more examples .
Thankyou


Type your question above this line.

Course: https://www.educative.io/collection/10370001/5473789393502208
Lesson: https://www.educative.io/collection/page/10370001/5473789393502208/5535257996558336

Hey @Priya_Sheth!
We have verified the code. It is working fine.
Boolean is a data type that can only return True or False. It is used to evaluate different expressions and conditions. Let’s see some examples to understand the Boolean data type.

print(5 > 2)

Output:

True

The above example evaluates the condition 5 > 2. As 5 is greater than 2, the boolean answer True is returned.
Similarly,

print(3 > 7)

Output:

False

The above example evaluates the condition 3 > 7. As 3 is not greater than 7, the boolean answer False is returned.

Thank you for asking the question. We hope Educative has inspired you to further your learning.