What does the following code print if 4 + 5 == 10?

Answer: False

== is a comparison operator, it returns boolean values that are True or False

+ operator has higher precedence than the == operator.
So the expression, 4 + 5 == 10 will become 9 == 10 which will return False.

Let’s see some code:

x = 4 + 5 == 10
print("The value of the expression is:",x)

# Output 
# The value of the expression is: False
Facebook
Twitter
LinkedIn
Pinterest

Leave a Reply

Your email address will not be published. Required fields are marked *

ABOUT ME !!
Johan William

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.

RECENT POSTS

TEST