File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ def reverse_bit(number: int) -> int:
4949 >>> reverse_bit(-1)
5050 Traceback (most recent call last):
5151 ...
52- ValueError: the value of input must be non-negative
52+ ValueError: The value of input must be non-negative
5353
5454 >>> reverse_bit(1.1)
5555 Traceback (most recent call last):
@@ -67,15 +67,15 @@ def reverse_bit(number: int) -> int:
6767 raise ValueError ("The value of input must be non-negative" )
6868
6969 result = 0
70- # iterator over [1 to 32 ], since we are dealing with a 32 bit integer
70+ # iterator over [0 to 31 ], since we are dealing with a 32 bit integer
7171 for _ in range (32 ):
7272 # left shift the bits by unity
7373 result <<= 1
7474 # get the end bit
7575 end_bit = number & 1
7676 # right shift the bits by unity
7777 number >>= 1
78- # add that bit to our ans
78+ # add that bit to our answer
7979 result |= end_bit
8080 return result
8181
You can’t perform that action at this time.
0 commit comments