Python 3 hash() built-in function TUTORIAL

preview_player
Показать описание
Tutorial on how to use the hash() built-in function from the Python 3 Standard Library.

📖 You can check out the Udemy course (Python Built-in Functions) here:

Timestamps:
0:00-0:48 Documentation
0:49-1:44 Hash Basics
1:45-2:48 Hash Comparison
2:49 Hash as a Boolean

💻 Built-in Functions Playlist:

📖 Documentation:

📖 References:

⚙️ Recommended Computer Gear:

✈️ Recommended Digital Nomad Gear:
Рекомендации по теме
Комментарии
Автор

It was good.

Just one thing, (I know it's a honest mistake), at 1:05 while passing hash on tuple, you forget to put comma after "6" which makes "6" again a string rather than tuple. Also, you can check hash values are same when "6" was passed as string and as tuple (which wasn't actually a tuple) inside hash function.

aman
Автор

why both the hash comparison and normal comparison are not true at 2:35 please explain this

nagar.gourang
Автор

Request!

A video on best practices for:

Decorators

Classes

Main name

And how to organize scripts in a professional manner. My scripts are all over the place. Should I use git?

chriskeo
Автор

1:45 -> One issue about Hash Comparison
"Comparing the hash to actual value is the same as comparing actual values (most of the time)" does not make sense to me. You only compared integers and their hashed values which actually evaluates to integers themselves. You cannot get the same results with any other type (even with floats except the ones that are actually integers) because hash() always returns int. So, hash(x) == x evaluates True only if x is an integer.

ybalcanci
Автор

Can u why
hash(2**60)==2**60 is true
hash(2**61)==2**61 is false

saikiran