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:
Manan Rathi
2021-10-20 14:12:32 +05:30
committed by GitHub
parent 83cf5786cd
commit 50485f7c8e
6 changed files with 18 additions and 19 deletions

View File

@ -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

View File

@ -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"

View File

@ -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))

View File

@ -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"