Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

"is" vs "==" in Python – What's the Difference? (And When to Use Each)

Автор: Real Python

Загружено: 2016-12-27

Просмотров: 74872

Описание:

https://dbader.org/python-tricks ► Write clean & Pythonic code and start using advanced features in your Python code

It's easy to get tripped up by Python's "is" and "==" operators for object comparison. In this video I'll explain the difference with a few easy to understand examples.

There's a difference in meaning between equal and identical. And this difference is important when you want to understand how Python's is and == comparison operators behave.

The == operator compares by checking for equality - the "is" operator, however, compares identities.

The difference between them breaks down to down to two short definitions:

An is expression evaluates to True if two variables point to the same (identical) object.

An == expression evaluates to True if the objects referred to by the variables are equal (have the same contents).

Check out this tutorial if you want to drill deeper: https://dbader.org/blog/difference-be...

FREE COURSE – "5 Thoughts on Mastering Python" https://dbader.org/python-mastery
PYTHON TRICKS: THE BOOK https://dbader.org/pytricks-book

SUBSCRIBE TO THIS CHANNEL: https://dbader.org/youtube

* *

► Python Developer MUGS, T-SHIRTS & MORE: https://nerdlettering.com

FREE Python Tutorials & News:
» Python Tutorials: https://dbader.org
» Python News on Twitter:   / @dbader_org  
» Weekly Tips for Pythonistas: https://dbader.org/newsletter
» Subscribe to this channel: https://dbader.org/youtube

"is" vs "==" in Python – What's the Difference? (And When to Use Each)

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

Python Function Argument Unpacking Tutorial (* and ** Operators)

Python Function Argument Unpacking Tutorial (* and ** Operators)

Python Quick Tip: The Difference Between

Python Quick Tip: The Difference Between "==" and "is" (Equality vs Identity)

Почему ваш код не соответствует Python (и как это исправить)

Почему ваш код не соответствует Python (и как это исправить)

Python if __name__ == '__main__': наглядное объяснение

Python if __name__ == '__main__': наглядное объяснение

Exec() VS Eval() Explained In Python Tutorial 2023

Exec() VS Eval() Explained In Python Tutorial 2023

Декораторы Python — наглядное объяснение

Декораторы Python — наглядное объяснение

Учебник Pydantic • Решение самой большой проблемы Python

Учебник Pydantic • Решение самой большой проблемы Python

Священная ВОЙНА редакторов кода - Vim против Emacs

Священная ВОЙНА редакторов кода - Vim против Emacs

Python — полный курс для начинающих. Этот навык изменит твою жизнь.

Python — полный курс для начинающих. Этот навык изменит твою жизнь.

FastAPI, Flask or Django - Which Should You Use?

FastAPI, Flask or Django - Which Should You Use?

25 привычек новичка в Python, от которых стоит избавиться

25 привычек новичка в Python, от которых стоит избавиться

String Conversion in Python: When to Use __repr__ vs __str__

String Conversion in Python: When to Use __repr__ vs __str__

Your Lists Are Being Copied WRONG In Python (Shallow Copy VS. Deep Copy)

Your Lists Are Being Copied WRONG In Python (Shallow Copy VS. Deep Copy)

Python Object Oriented Programming (OOP) - For Beginners

Python Object Oriented Programming (OOP) - For Beginners

Я ненавижу длинные цепочки If-Elif: этот шаблон проектирования решил эту проблему раз и навсегда

Я ненавижу длинные цепочки If-Elif: этот шаблон проектирования решил эту проблему раз и навсегда

Python Context Managers and the

Python Context Managers and the "with" Statement (__enter__ & __exit__)

Весь синтаксис Python за 25 минут – Учебное пособие

Весь синтаксис Python за 25 минут – Учебное пособие

What is the difference between == (Equality) and is (Identity) in Python | Interview Questions #13

What is the difference between == (Equality) and is (Identity) in Python | Interview Questions #13

is vs == in Python

is vs == in Python

Map, Filter, and Reduce Functions  ||  Python Tutorial  ||  Learn Python Programming

Map, Filter, and Reduce Functions || Python Tutorial || Learn Python Programming

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: infodtube@gmail.com