Skip to content

Commit 7b99ad1

Browse files
authored
Update binary_coded_decimal.py
1 parent 6b80a83 commit 7b99ad1

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

bit_manipulation/binary_coded_decimal.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ def binary_coded_decimal(number: int) -> str:
1818
>>> binary_coded_decimal(987)
1919
'0b100110000111'
2020
"""
21-
if number < 0:
22-
return "0b0000"
2321
return "0b" + "".join(str(bin(int(digit)))[2:].zfill(4) for digit in str(max(0, number)))
2422

2523

0 commit comments

Comments
 (0)