diff --git a/02-cpu-commnads/hex2bin.py b/02-cpu-commnads/hex2bin.py new file mode 100755 index 0000000..55c6faf --- /dev/null +++ b/02-cpu-commnads/hex2bin.py @@ -0,0 +1,11 @@ +#!/usr/bin/python3 +import sys + +def hex2bin(hexNum: str) -> None: + return bin(int(hexNum, 16)) + +if (len(sys.argv) > 1): + print(hex2bin(sys.argv[1])) +else: + print("No number passed") +