BERKYT

min or max in matrix

Dec 19th, 2021 (edited)
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. def min_max(matrix: list, func_check):
  2.     list_matrix = matrix.copy()
  3.     list_var = []
  4.  
  5.     for item in list_matrix:
  6.         list_var.append(func_check(item))
  7.  
  8.     return func_check(list_var)
  9.  
  10.  
  11. print(min_max([[1, 2, 3, -1000, 4], [1, 2, 4, 1, 1000]], max))
  12. print(min_max([[1, 2, 3, -1000, 4], [1, 2, 4, 1, 1000]], min))
Add Comment
Please, Sign In to add comment