+ 3

Could anyone explain how is and is not operator works in python?

11th Jun 2019, 5:10 AM
Dipra Irham
Dipra Irham - avatar
3 odpowiedzi
+ 7
This code might explain you it. https://code.sololearn.com/cVE2qBCAXVep/?ref=app
11th Jun 2019, 5:13 AM
Raj Chhatrala
Raj Chhatrala - avatar
+ 5
"is" mean is the memory address of the value... if a=b, possibly "a" and "b" addresses the same... we can say (a is b) absolutely True... but for example a=[1,2,3,4] and b=[1,2,3,4] looks like the same list... (a == b) absolutely True... "a" named list created different memory allocation than "b" named list... They took the same named items but lists memory addresses different each other. because of this reason (a is b) absolutely False.
17th Aug 2019, 8:32 PM
Mark Smith
Mark Smith - avatar
11th Jun 2019, 5:32 AM
Dipra Irham
Dipra Irham - avatar