mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 01:09:40 +08:00
Enable ruff PLR5501 rule (#11332)
* Enable ruff PLR5501 rule * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@ -73,12 +73,11 @@ def cramers_rule_2x2(equation1: list[int], equation2: list[int]) -> tuple[float,
|
||||
raise ValueError("Infinite solutions. (Consistent system)")
|
||||
else:
|
||||
raise ValueError("No solution. (Inconsistent system)")
|
||||
elif determinant_x == determinant_y == 0:
|
||||
# Trivial solution (Inconsistent system)
|
||||
return (0.0, 0.0)
|
||||
else:
|
||||
if determinant_x == determinant_y == 0:
|
||||
# Trivial solution (Inconsistent system)
|
||||
return (0.0, 0.0)
|
||||
else:
|
||||
x = determinant_x / determinant
|
||||
y = determinant_y / determinant
|
||||
# Non-Trivial Solution (Consistent system)
|
||||
return (x, y)
|
||||
x = determinant_x / determinant
|
||||
y = determinant_y / determinant
|
||||
# Non-Trivial Solution (Consistent system)
|
||||
return (x, y)
|
||||
|
Reference in New Issue
Block a user