What is the output of the following statement in Python : print( 5 == 5)
Answers
print(5 == 5) will return 'True'.
Explanation:
The above statement is more of a Boolean statement. A Boolean statement is that which returns either 'True'/'False'. It is mostly done with the use of relational operators, that tests the relationship between two or more elements.
The '==' operator is used for testing whether or not the Left Hand Side of the operator is equivalent to the Right Hand Side.
Since 5 = 5, it returns 'True'.
Other operators that return 'True'/'False' include:
- Lesser than <
- Greater than >
- Not equal to !=
- Lesser than or equal to <=
- Greater than or equal to >=
Required answer:-
Question:
• What is the output of the following statement in Python : print( 5 == 5).
Answer:
print( 5== 5)
Will be True
Step by step explaination:
As, the relational operators determine the relationship between the one operand has to the other. The outcome not these questions is a boolean value which is either true or false.
There are six relational operators:
Operators Symbol
Greater than >
Less than <
Equal to ==
Greater than or equal to >=
Less than or equal to <=
Not equal to !=
The "Equal to" or "== " operator finds whether L.H.S. = R.H.S. or not.
Note:
________________________________
Relational operators have a lower priority than arithmetic operators. This means if in an arithmetic operators are used with relational operators, the arithmetic operators will be evaluated first.
________________________________