We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 172bfbf commit 9f37a60Copy full SHA for 9f37a60
bit_manipulation/count_number_of_one_bits.py
@@ -1,4 +1,4 @@
1
-def count_one_bits(number: int) -> int:
+def get_set_bits_count(number: int) -> int:
2
"""
3
Count the number of set bits in a 32 bit integer
4
>>> count_one_bits(25)
@@ -20,11 +20,7 @@ def count_one_bits(number: int) -> int:
20
>>> count_one_bits(1.1)
21
Traceback (most recent call last):
22
...
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'
+ TypeError: Input value must be a 'int' type
28
29
if number < 0:
30
raise ValueError("the value of input must be positive")
0 commit comments