mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-07 03:07:46 +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:
@ -1,7 +1,6 @@
|
||||
https://docs.python.org/3/reference/expressions.html#binary-bitwise-operations
|
||||
https://docs.python.org/3/reference/expressions.html#unary-arithmetic-and-bitwise-operations
|
||||
https://docs.python.org/3/library/stdtypes.html#bitwise-operations-on-integer-types
|
||||
|
||||
https://wiki.python.org/moin/BitManipulation
|
||||
https://wiki.python.org/moin/BitwiseOperators
|
||||
https://www.tutorialspoint.com/python3/bitwise_operators_example.htm
|
||||
* https://docs.python.org/3/reference/expressions.html#binary-bitwise-operations
|
||||
* https://docs.python.org/3/reference/expressions.html#unary-arithmetic-and-bitwise-operations
|
||||
* https://docs.python.org/3/library/stdtypes.html#bitwise-operations-on-integer-types
|
||||
* https://wiki.python.org/moin/BitManipulation
|
||||
* https://wiki.python.org/moin/BitwiseOperators
|
||||
* https://www.tutorialspoint.com/python3/bitwise_operators_example.htm
|
||||
|
@ -22,7 +22,7 @@ def binary_and(a: int, b: int) -> str:
|
||||
>>> binary_and(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_and(0, 1.1)
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
@ -33,7 +33,7 @@ def binary_and(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:] # remove the leading "0b"
|
||||
|
@ -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))
|
||||
|
@ -22,7 +22,7 @@ def binary_xor(a: int, b: int) -> str:
|
||||
>>> binary_xor(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_xor(0, 1.1)
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
@ -33,7 +33,7 @@ def binary_xor(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:] # remove the leading "0b"
|
||||
|
Reference in New Issue
Block a user