Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

The ouput is False how please explaint it?

The output is False how can anyone please explain it?

a = True
b  = False
print(a == b)

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

a = True
b  = False
print(a == b)

The print statement looks what to print and encounters a==b which is an expression and not a value and therefore must be evaluated to a value which is then printed. a == b is a request to check if value of a equals to (is the same as) value of b. They are not the same as a==True, but b==False. So the expression/statement a==b is not true, what means that it is False and False is a boolean value and can be printed, so the printed output will be:

False
  • = assigns to the left the value which comes from what is right of it.
  • == compares the value to the left of it to the value to the right of it to check if they are equal and evaluates to (returns) a boolean True if they are and False if they not equal.
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading