mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 09:21:13 +08:00
Fix typos in Sorts and Bit_manipulation (#4949)
* Fix several typos * Update bit_manipulation/README.md Co-authored-by: John Law <johnlaw.po@gmail.com> * Update double_sort.py Co-authored-by: John Law <johnlaw.po@gmail.com>
This commit is contained in:
@ -21,7 +21,7 @@ def binary_or(a: int, b: int) -> str:
|
||||
>>> binary_or(0, -1)
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
ValueError: the value of both input must be positive
|
||||
ValueError: the value of both inputs must be positive
|
||||
>>> binary_or(0, 1.1)
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
@ -32,7 +32,7 @@ def binary_or(a: int, b: int) -> str:
|
||||
TypeError: '<' not supported between instances of 'str' and 'int'
|
||||
"""
|
||||
if a < 0 or b < 0:
|
||||
raise ValueError("the value of both input must be positive")
|
||||
raise ValueError("the value of both inputs must be positive")
|
||||
a_binary = str(bin(a))[2:] # remove the leading "0b"
|
||||
b_binary = str(bin(b))[2:]
|
||||
max_len = max(len(a_binary), len(b_binary))
|
||||
|
Reference in New Issue
Block a user