mirror of
https://github.com/TheAlgorithms/Python.git
synced 2026-03-13 09:50:19 +08:00
Fix ruff (#11527)
* updating DIRECTORY.md
* Fix ruff
* Fix
* Fix
* Fix
* Revert "Fix"
This reverts commit 5bc3bf3422.
* find_max.py: noqa: PLR1730
---------
Co-authored-by: MaximSmolskiy <MaximSmolskiy@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
This commit is contained in:
@@ -20,7 +20,7 @@ def find_max_iterative(nums: list[int | float]) -> int | float:
|
||||
raise ValueError("find_max_iterative() arg is an empty sequence")
|
||||
max_num = nums[0]
|
||||
for x in nums:
|
||||
if x > max_num:
|
||||
if x > max_num: # noqa: PLR1730
|
||||
max_num = x
|
||||
return max_num
|
||||
|
||||
|
||||
@@ -61,8 +61,7 @@ def _binomial_coefficient(total_elements: int, elements_to_choose: int) -> int:
|
||||
if elements_to_choose in {0, total_elements}:
|
||||
return 1
|
||||
|
||||
if elements_to_choose > total_elements - elements_to_choose:
|
||||
elements_to_choose = total_elements - elements_to_choose
|
||||
elements_to_choose = min(elements_to_choose, total_elements - elements_to_choose)
|
||||
|
||||
coefficient = 1
|
||||
for i in range(elements_to_choose):
|
||||
|
||||
Reference in New Issue
Block a user