+ 1
can anybody explain why The output of print([] is []) is False. thanks very much
6 Réponses
+ 3
Which language?
+ 1
Please write true syntax for help, generally may be a logical compare
+ 1
print([] is []) = false and print([] == []) = true.
The "is" operator compares the identity of two objects while the == operator compares the values of two objects. There is a difference in meaning between equal and identical. And this difference is important when you want to understand how Python's is and == comparison operators behave. More...
http://net-informations.com/python/iq/is.htm
0
python3
0
rahul kumar good explanation!