What is the difference between `is` and `==` in Python?

Python Developer Hard

Python Developer — Hard

What is the difference between `is` and `==` in Python?

Key points

  • `is` checks object identity, `==` checks value equality
  • `is` compares memory addresses, `==` compares values
  • `is` is stricter than `==` in comparing variables

Ready to go further?

Related questions