A stroll outside the decimal system
Published in · 7 min read · Sep 15, 2020
--
Python is known for being powerful and easy to use when it comes to math. Both its native capabilities and resourceful libraries like NumPy, Pandas, or Scikit-learn, provide developers with the necessary tools for heavy lifting numbers. But sometimes we need to step outside the decimal world and work with one of the other common number bases.
A number base is the number of digits that a system of counting uses to represent numerical values. The most prevalent number system is the decimal system, also known as base 10. In decimal, the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 represent every possible value. But computers and software developers often need to use other bases.
Of all its cousins, the decimal system invites binary, hexadecimal, and octal over for dinner the most. The others fall into that special category of cousin you avoid when you’re with friends. However, if you plan on using binary, hexadecimal, or octal you may need to brush up on your Python. They are not as clean and easy to use in Python as base…