Skip to content

A short and sweet integer converter as a challenge.

Notifications You must be signed in to change notification settings

vhenwie/integer-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Python Integer Converter Base-2/8/16

A simple cli app that takes in an integer and converts it to Binary (Base-2), Octal (Base-8), and Hexadecimal (Base-16).

About

This is a piece of code that I was supposed to submit to a Facebook Live challenge, hosted by Frace Marteja.

Challenge

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.

Usage

# app.py
Enter a decimal value: 1023
> Octal: 1777
> Hexadecimal: 03FF
> Binary: 1111111111

About

A short and sweet integer converter as a challenge.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages