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

Updated on: 26-Feb-2020

100 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements