PLEASE SUBSCRIBE!!!
In the previous lesson ( • Python Programming: Lesson 67 - The C... ), we saw the callable function and discussed frozen dictionaries in more depth. We created a subclass called callableFrozenDict and provided it with a subclass that has a call magic method. callable(x) is a standard Python function that accepts an input x and returns True if and only if x is either 1) a function or 2) an instance of a class that supplies the call magic method.
In this lesson, we learn about hexadecimal numbers in Python. Binary numbers are base 2, decimal numbers are base 10, and hexadecimal numbers are base 16: 0123456789abcdef. We denote hex numbers as starting with 0x. hex(x) is a Python function that accepts an integer and returns the hexadecimal representation of it. int(0x52) can be used to turn a hexadecimal number back into a standard integer.
0:03 Review of Frozen Dictionaries
3:19 Review of the Callable Function
4:12 Review of eval(x) and iter(x)
5:05 Review of JSON
7:23 Example of Frozen Dictionaries
9:16 Example of Callable
11:02 NEW: hex(177) to convert an int into hexadecimal representation
17:28 NEW: int(0x5b) to convert a hex into an integer representation
In the next and final lesson ( • Python Programming: Lesson 69 - Chara... ), we will learn about the chr and ord functions, which allow us to go back and forth between an integer character encoding and an actual character. We will also study the zip function, which is a generator that yields corresponding pairs between two iterables. Wrap it up!
Thanks for watching, and PLEASE SUBSCRIBE!!!