mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-06 02:13:15 +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:
@ -177,13 +177,15 @@ def _enforce_args(n: int, prices: list):
|
||||
the rod
|
||||
"""
|
||||
if n < 0:
|
||||
raise ValueError(f"n must be greater than or equal to 0. Got n = {n}")
|
||||
msg = f"n must be greater than or equal to 0. Got n = {n}"
|
||||
raise ValueError(msg)
|
||||
|
||||
if n > len(prices):
|
||||
raise ValueError(
|
||||
"Each integral piece of rod must have a corresponding "
|
||||
f"price. Got n = {n} but length of prices = {len(prices)}"
|
||||
msg = (
|
||||
"Each integral piece of rod must have a corresponding price. "
|
||||
f"Got n = {n} but length of prices = {len(prices)}"
|
||||
)
|
||||
raise ValueError(msg)
|
||||
|
||||
|
||||
def main():
|
||||
|
Reference in New Issue
Block a user