Equality versus identity in Python

Published: 28 May 2024
on channel: Python Morsels
359
30

Equality checks whether two objects represent the same value. Identity checks whether two variables point to the same object.

Equality is checked with "==" and identity is checked with "is".

Article at https://pym.dev/equality-vs-identity/

More #Python screencasts at https://pym.dev/screencasts/

00:00 The equality operator in Python
00:45 The "is" operator in Python
01:34 How equality and identity work differently?
02:21 Inequality and non-identity operators
02:47 Where are identity checks used?
03:28 Equality vs. Identity


Watch video Equality versus identity in Python online without registration, duration hours minute second in high quality. This video was added by user Python Morsels 28 May 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 359 once and liked it 30 people.