Python repr vs str
Understand repr vs str in Python and learn how to use them in any custom class. Examples of using repr for debugging.
Code
Inside articles there are more settings: width, font size, series position and code.
Saved in this browser.
Understand repr vs str in Python and learn how to use them in any custom class. Examples of using repr for debugging.
What makes a Python object hashable, why lists aren't, how hash(), __hash__ and __eq__ work together, and how to make your own class hashable.
Learn whether a variable can change (mutable) or not (immutable). Mutable: List, Dict, Set. Immutable: String, Int, Float, Bool, Tuple, Range, Decimal.
Learn how to build your own Collection in Python step by step: Container, Sized and Iterable explained, plus the difference between an Iterator and an Iterable.
Learn how to build a data stream by balancing memory use and processing time: buffer data for a steady flow, generate data on demand, and cache results.
Learn how numeral system combination tables work and convert between binary, decimal, hexadecimal and octal with simple mental math.
Learn what the binary number system is, how it relates to decimal, octal, hexadecimal and base 64, and how to read bases and number notations.
Learn the units of information: bit, byte, kilo vs kibi, GB vs GiB. Understand the old and new systems so nobody fools you about storage or speed.
The bit, the basic unit of digital information. It represents two states: the binary system. Something so simple, yet important and full of potential.
Learn Hamming distance, Hamming weight, Hamming space and spheres, plus how error-correcting codes detect and fix errors, with Hamming(7,4) as the example.
Hamming code to detect and correct errors. Step-by-step examples for fixing errors using redundancy bits and the syndrome matrix. Learn how it works.
Hash Table explained simply. What is a Hash Table and how does it work without writing code? A key type of "data structure" every developer should know.