+ 1
Difference between '==' and 'is'
i made a simple if program : x = 'foo' y = 'egg' if x is y: print("x&y is the same") elif y is x: print("y&x is the same") else: print("both are same") so what's the difference between == and is operator? Edit : i can't still figure it out
3 Answers
+ 4
Is is only used for strings while == can be used anywhere and it is more comfortable to.(If you get it leave a mark up if you don't email ivansing23@gmail.com)
0
hi!
0
"==" means equivalent, "is" means exactly the same.