Skip to content

Commit 9f37a60

Browse files
Update count_number_of_one_bits.py
1 parent 172bfbf commit 9f37a60

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

bit_manipulation/count_number_of_one_bits.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
def count_one_bits(number: int) -> int:
1+
def get_set_bits_count(number: int) -> int:
22
"""
33
Count the number of set bits in a 32 bit integer
44
>>> count_one_bits(25)
@@ -20,11 +20,7 @@ def count_one_bits(number: int) -> int:
2020
>>> count_one_bits(1.1)
2121
Traceback (most recent call last):
2222
...
23-
TypeError: Input value must be a 'int' type
24-
>>> count_one_bits("0")
25-
Traceback (most recent call last):
26-
...
27-
TypeError: '<' not supported between instances of 'str' and 'int'
23+
TypeError: Input value must be a 'int' type
2824
"""
2925
if number < 0:
3026
raise ValueError("the value of input must be positive")

0 commit comments

Comments
 (0)