denyy
answered Sep 19 '21 00:00
!= is not same as == .
in fact , != is opposite to == .
!= is not equal to operator
with != operator , one can test two variable's value and type are not equal to or not in Python.
!= operator example in Python
x=121
y=12
if(x!=y):
# x is not equal to y do something
== is equal to check operator
with == (double equal to) operator , one can test two variable's value and type are equal to or not in Python.
== operator example in Python
x=121
y=12
if(x==y):
# x is equal to y do something
else:
# x is not equal to y do something
you can say !(!=) is equal to ==