+ 1

can anybody explain why The output of print([] is []) is False. thanks very much

13th Aug 2019, 2:52 AM
mingyi cheng
mingyi cheng - avatar
6 ответов
+ 3
Which language?
13th Aug 2019, 2:54 AM
Sonic
Sonic - avatar
+ 1
Please write true syntax for help, generally may be a logical compare
13th Aug 2019, 2:58 AM
Vahid Vakili
Vahid Vakili - avatar
+ 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
22nd May 2020, 5:12 AM
rahul kumar
rahul kumar - avatar
0
python3
13th Aug 2019, 3:58 AM
mingyi cheng
mingyi cheng - avatar
0
rahul kumar good explanation!
7th Jul 2020, 4:55 PM
Zachiah sawyer
Zachiah sawyer - avatar