This Python functions convert numbers between different numeral systems. It is inspired by a practice project from the Python programming course "Python Generation: Beginner's Course".
The file consists of several functions, each responsible for converting numbers between specific numeral systems:
- bin2dec(num: str) -> int: Converts binary numbers to decimal.
- hex2dec(num: str) -> int: Converts hexadecimal numbers to decimal.
- dec2hex(num: str) -> str: Converts decimal numbers to hexadecimal.
- dec2bin(num: str) -> int: Converts decimal numbers to binary.
- uptonine2dec(num: str, base: int) -> int: Converts numbers from any base from 1 to 9 to decimal.
- Import the
numeral_system_calculator
module into your own Python script and use its functions. - Alternatively, you can edit calls in the
main()
and run the original Python file directly to execute the conversions.
Sergey Torshin @torshin5ergey