Have you heard the one about \`is\`, \`==\`, and the £5 note that it's your pocket?

You may have already come across the fact that \`is\` and \`==\` are not the same in Python and cannot be used interchangeably… if you haven't, you heard it now!

But why? Let's see what the £5 note has got to do with this story

Let's assume you and I both have a £5 note in our pocket

_[replace with currency of choice]_
and
_[read "bill" instead of "note" if you wish]_

We meet up and go to a coffee shop nearby to buy two coffees which cost £5 altogether

Does it matter which £5 note we use to pay?

/1

_[this is like a Netflix series you can binge on, no need to wait until next week for the next episode, read on in the next toot in this thread…]_

@folkerschamel if using CPython, as most do. Also, you’ll get a different result if you that in a script rather than the shell/REPL

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.