Skip to content

Commit a14ecb4

Browse files
Clarify binary to hexadecimal conversion process
Added comment to clarify the use of built-in functions for conversion.
1 parent 6b45f70 commit a14ecb4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

conversions/binary_to_hexadecimal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def bin_to_hexadecimal(binary_str: str) -> str:
2727

2828
if not binary_str or not all(char in "01" for char in binary_str):
2929
raise ValueError("Non-binary value was passed to the function")
30-
30+
# Uses built-in int() for binary parsing and hex() for conversion
3131
hex_str = "0x" + hex(int(binary_str, 2))[2:]
3232
if hex_str == "0x0":
3333
is_negative = False

0 commit comments

Comments
 (0)