A Crazy Python Dictionary Expression ?!
https://dbader.org/python-tricks ► Master advanced features in Python with free & easy to digest code examples
We're going to pry apart this slightly unintuitive Python dictionary expression to find out what’s going on in the uncharted depths of the Python interpreter.
A while ago I shared a Python one-liner as a “Python riddle” on Twitter and it got some interesting reactions:
{ True: 'yes', 1: 'no', 1.0: 'maybe' }
Take a quick moment to think about what this dict expression will evaluate to.
You might be surprised...
Watch the video or read the full article to learn more about Python dictionaries, hashing and key collisions: https://dbader.org/blog/python-mystery-dict-expression
FREE COURSE – "5 Thoughts on Mastering Python" https://dbader.org/python-mastery
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: https://twitter.com/@dbader_org
» Weekly Tips for Pythonistas: https://dbader.org/newsletter
» Subscribe to this channel: https://dbader.org/youtube
Видео A Crazy Python Dictionary Expression ?! канала Real Python
We're going to pry apart this slightly unintuitive Python dictionary expression to find out what’s going on in the uncharted depths of the Python interpreter.
A while ago I shared a Python one-liner as a “Python riddle” on Twitter and it got some interesting reactions:
{ True: 'yes', 1: 'no', 1.0: 'maybe' }
Take a quick moment to think about what this dict expression will evaluate to.
You might be surprised...
Watch the video or read the full article to learn more about Python dictionaries, hashing and key collisions: https://dbader.org/blog/python-mystery-dict-expression
FREE COURSE – "5 Thoughts on Mastering Python" https://dbader.org/python-mastery
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: https://twitter.com/@dbader_org
» Weekly Tips for Pythonistas: https://dbader.org/newsletter
» Subscribe to this channel: https://dbader.org/youtube
Видео A Crazy Python Dictionary Expression ?! канала Real Python
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
![String Conversion in Python: When to Use __repr__ vs __str__](https://i.ytimg.com/vi/aIdzBGzaxUo/default.jpg)
![Python Function Argument Unpacking Tutorial (* and ** Operators)](https://i.ytimg.com/vi/YWY4BZi_o28/default.jpg)
![Python Context Managers and the "with" Statement (__enter__ & __exit__)](https://i.ytimg.com/vi/iba-I4CrmyA/default.jpg)
![Method Types in Python OOP: @classmethod, @staticmethod, and Instance Methods](https://i.ytimg.com/vi/PNpt7cFjGsM/default.jpg)
![What's the meaning of underscores (_ & __) in Python variable names?](https://i.ytimg.com/vi/ALZmCy2u0jQ/default.jpg)
![](https://i.ytimg.com/vi/Pj6z7Eq1TJY/default.jpg)
![Exceptions in Python || Python Tutorial || Learn Python Programming](https://i.ytimg.com/vi/nlCKrKGHSSk/default.jpg)
![](https://i.ytimg.com/vi/8BvVg55PIpY/default.jpg)
![Emulating switch/case Statements in Python with Dictionaries](https://i.ytimg.com/vi/gllUwQnYVww/default.jpg)
![How-To: Python Programming Dicts, Dict Loops & DefaultDicts](https://i.ytimg.com/vi/JUxmCUlZoi8/default.jpg)
![Python Coding Problem: Creating Your Own Iterators](https://i.ytimg.com/vi/C3Z9lJXI6Qw/default.jpg)
![10 Python tips and tricks you should check out](https://i.ytimg.com/vi/gcNfOs7AN0A/default.jpg)
![Getting Started With Pandas Sort Methods](https://i.ytimg.com/vi/gUDkkF1ox0Y/default.jpg)
![Объектно ориентированное программирование в Python за 10 минут!](https://i.ytimg.com/vi/XmCAGUo5k70/default.jpg)
![Python Tutorial for Beginners 5: Dictionaries - Working with Key-Value Pairs](https://i.ytimg.com/vi/daefaLgNkw0/default.jpg)
![“Learning to Code is Not Just for Coders” | Ali Partovi | TEDxSausalito](https://i.ytimg.com/vi/MvTSPwftvyo/default.jpg)
!["For Each" Loops in Python with enumerate() and range()](https://i.ytimg.com/vi/URxQGA9f_AA/default.jpg)
![Optional Arguments in Python With *args and **kwargs](https://i.ytimg.com/vi/WcTXxX3vYgY/default.jpg)
![Understanding Python: Lesson 82 - collections](https://i.ytimg.com/vi/BMiB-x5A8Mc/default.jpg)
![Automate Multiple Sheet Excel Reporting - Python Automation Tutorial | Full Code Walk Through (2019)](https://i.ytimg.com/vi/1Kcco6koC34/default.jpg)