Lab 2: Базовые команды и кодирование для процессора #2
11
02-cpu-commnads/hex2bin.py
Executable file
11
02-cpu-commnads/hex2bin.py
Executable file
@ -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")
|
||||
|
||||
Reference in New Issue
Block a user