Why second output is False? Please help me? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why second output is False? Please help me?

https://code.sololearn.com/c883l005209q/?ref=app

11th Oct 2020, 7:23 AM
Satyam Mishra
Satyam Mishra - avatar
9 Answers
+ 4
I had run it it shows Both True False
11th Oct 2020, 7:24 AM
🔰Saurabh🔰
🔰Saurabh🔰 - avatar
+ 3
Then what you want
11th Oct 2020, 7:25 AM
🔰Saurabh🔰
🔰Saurabh🔰 - avatar
+ 3
Because list one is same as list 2 but list 1 is not list 2
11th Oct 2020, 7:40 AM
🔰Saurabh🔰
🔰Saurabh🔰 - avatar
+ 2
Similar and equals are different. For example, Two twin sister, same hair, same cloths, same eyes... They are equals? Yes. They are the same? No. Are two sister, not the same. I have a laptop, a lot of peoples have same laptop, but not it. It's mine.
12th Oct 2020, 1:53 AM
Marcelo Anjos
Marcelo Anjos - avatar
+ 2
Actually u created two lists Then u tested if the both list have same objects which came true And Then U tested using 'is' keyword which checked whether the both lists are stored on same memory address and u created two different lists so It came to be false. Note If u try the same with integer variable till 256 it will show true because when we create two in objects of less than 256 and same value they are stored at same memory address u can verify the same by using id(variable_name)
13th Oct 2020, 5:29 AM
Namit Aggarwal
0
yes! But why second output is false..
11th Oct 2020, 7:25 AM
Satyam Mishra
Satyam Mishra - avatar
0
I want to know why second output is false.
11th Oct 2020, 7:28 AM
Satyam Mishra
Satyam Mishra - avatar
0
But both object is same?
11th Oct 2020, 7:33 AM
Satyam Mishra
Satyam Mishra - avatar
0
Wow what a exact answer👍👍👍👍
12th Oct 2020, 6:38 AM
Satyam Mishra
Satyam Mishra - avatar