Use the equality operator to compare the values of the objects. Identity operator is used to verifying that objects are equal but are not referring to the same object in memory.
Use cases where identity operator is used are:
There may be use cases where the output returned by both the operators is the same. But, in your program, you have used the identity operator instead of the equality operator.
To avoid such mistakes it is important to understand the difference between identity and equality operator.