== operator compares the operands by checking the equality of values of objects.
is operator compares the operands by checking the objects to be the same or not.
Following is the program in Python to showcase the difference.
list1 = [1] list2 = [1] list3 = list1 print(id(list1)) print(id(list2)) if (list1 == list2): print("True") else: print("False") if (list1 is list2): print("True") else: print("False") if (list1 is list3): print("True") else: print("False")
140380664377096 140380664376904 True False True