Computer >> Computer tutorials >  >> Programming >> Python

How does == operator works in Python 3?


The == symbol is defined as equality operator. It returns true if expressions on either side are equal and false if they are not equal

>>> (10+2) == 12
True
>>> 5*5 == 5**2
True
>>> (10/3)==3
False
>>> 'computer'=="computer"
True
>>> 'COMPUTER'.lower()=='computer'
True