rikosintie / convert

Convert between decimal, hex, binary

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

convert

Simple Python script to convert between decimal, hex, binary

Convert Binary to Decimal and Hex

convert.py -n 0b1111
 Binary Value:  1111
Decimal Value:  15
    Hex Value:  0xf

Convert Hex to decimal and Binary

convert.py -n 0x10
 Binary Value:  0b10000
Decimal Value:  16
    Hex Value:  10

Convert Decimal to Binary and Hex

convert.py -n 16
    Decimal Value:  16
     Binary value:  0b10000
Hexidecimal value:  0x10

There is some basic error trapping

Hex

convert.py -n 0xah
Number can only contain a-f

Binary

convert.py -n 0b1112
Number can only contain 0 and 1

About

Convert between decimal, hex, binary

License:The Unlicense


Languages

Language:Python 100.0%