mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-04 08:50:41 +08:00
Add more ruff rules (#8767)
* Add more ruff rules * Add more ruff rules * pre-commit: Update ruff v0.0.269 -> v0.0.270 * Apply suggestions from code review * Fix doctest * Fix doctest (ignore whitespace) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@ -14,10 +14,11 @@ def get_reverse_bit_string(number: int) -> str:
|
||||
TypeError: operation can not be conducted on a object of type str
|
||||
"""
|
||||
if not isinstance(number, int):
|
||||
raise TypeError(
|
||||
msg = (
|
||||
"operation can not be conducted on a object of type "
|
||||
f"{type(number).__name__}"
|
||||
)
|
||||
raise TypeError(msg)
|
||||
bit_string = ""
|
||||
for _ in range(0, 32):
|
||||
bit_string += str(number % 2)
|
||||
|
Reference in New Issue
Block a user