To check if a number isn't equal to another number, we use the inequality operator, !=
.
print(1 != 10)
We can store the result of a comparison with the inequality operator in a variable like here where we'll store the comparison 1 != 2
.
result = 1 != 2
print(result)
To check if a string isn't equal to another string, we use the inequality operator, !=
.
print("subscribed" != "rejected")