A simple cli app that takes in an integer and converts it to Binary (Base-2), Octal (Base-8), and Hexadecimal (Base-16).
This is a piece of code that I was supposed to submit to a Facebook Live challenge, hosted by Frace Marteja.
1. We divide the decimal number by 8/16/2 because 8/16/2 is a base value of octal/hexadecimal/binary numbers.
2. We keep on dividing until the quotient becomes zero.
3. The remainders are noted down and written in the reverse order in the combined form.
# app.py
Enter a decimal value: 1023
> Octal: 1777
> Hexadecimal: 03FF
> Binary: 1111111111