![]() "=".Įxecute the following code to see the output: a = 2Īs expected, since a is not equal to b (*with values 2 and 4 *), the answer returned is False. The "equal to" operator is denoted by two equal signs i.e. The python equal to operator returns True if the two operands under consideration are equal to each other. Python Comparison Operatorsīelow is the list of six comparison operators used in Python. In this post, we will go through the six comparison operators in python and examine all of them with examples. These operators are used exhaustively from small to large programs in logic building and are therefore one of the most important concepts in the PCEP course. Comparison operators are also called relational operators as they find the relation between the operands (greater than, equal, etc.) and generate a boolean value in terms of True and False.
0 Comments
Leave a Reply. |