Skip to content

Commit ea1a96e

Browse files
committed
changed valueerror to none
1 parent 2818711 commit ea1a96e

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

data_structures/arrays/max_and_min.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,15 @@
1212
"""
1313

1414

15-
def find_max_min(arr: list[int]) -> tuple[int, int]:
15+
def find_max_min(arr: list[int]) -> tuple[int | None, int | None]:
1616
"""
1717
Returns the maximum and minimum elements of a list.
1818
1919
Parameters:
2020
arr (list[int]): The list of numbers.
2121
2222
Returns:
23-
Tuple[int, int]: (maximum, minimum)
24-
25-
Raises:
26-
ValueError: If the list is empty.
23+
tuple[int | None, int | None]: (maximum, minimum), or (None, None) if the list is empty.
2724
"""
2825
if not arr:
2926
raise ValueError("find_max_min() arg is an empty list")

0 commit comments

Comments
 (0)