---
title: "What is the difference between == and is in Python?"  
description: "What is the difference between == and is in Python?"  
author: "ICSM Computer"  
published: 2025-03-27  
updated: 2025-04-08  
canonical: https://www.mindstick.com/forum/161370/what-is-the-difference-between-and-is-in-python  
category: "python"  
tags: ["python"]  
reading_time: 2 minutes  

---

# What is the difference between == and is in Python?

What is the [difference](https://www.mindstick.com/articles/157114/good-news-or-bad-news-and-the-difference-is) between `==` and `is` in Python?

## Replies

### Reply by Khushi Singh

The [Python programming language](https://www.mindstick.com/articles/65137/what-is-python-programming) includes the == and is operators for comparison operations, even though they provide distinct functions.

**== (Equality Operator)**\
The double-equal sign operator functions as a method to evaluate variable value equality in Python. The conditional statement returns True when value equality exists between items, regardless of whether they reside in separate parts of memory. The equality operator evaluates the value of two elements.

**is (Identity Operator)**\
During operation, the is operator confirms that the variables are assigned to the same storage location in memory. The is operator provides a True response only when two variables indicate the same memory location, hence sharing the same identity between them as opposed to simply equal values. The is operator enables checking of object identity between variables.

## Example

```python
a = [1, 2, 3]
b = [1, 2, 3]
print(a == b)  # True – values are equal
print(a is b)  # False – different memory locations
c = a
print(a is c)  # True – both point to the same object
```

## Summary

- You should use == when checking if two objects possess equivalent values.
- To verify if two references point to the same stored object in memory, you should use the is operator.

The distinction matters most when working with custom objects and immutable types such as strings and integers, since [Python](https://www.mindstick.com/blog/165357/why-python-do-is-said-to-be-an-important-language) might share objects for performance reasons.


---

Original Source: https://www.mindstick.com/forum/161370/what-is-the-difference-between-and-is-in-python

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
