What does != do/mean in python

!= means “not equal to” and is a logical comparison. Break down the logical expression here:

2 and 1 - 2 != 3
2 and -1 != 3
2 and True
True

Leave a Comment