You can use "!=" and "is not" for not equal operation in Python. The python != ( not equal operator ) return True, if the values of the two Python operands given on each side of the operator are not equal, otherwise false . Python is dynamically, but strongly typed , and other statically typed languages would complain about comparing different types . So if the two variables have the same values but they are of different type, then not equal operator will return True.
str = 'halo'
if str == 'halo': # equal
print ("halo")
elif str != 'halo': # not equal
print ("no halo")