UniCoreFW

max()

Gets the maximum value in an array

Implementation

Uses Python's max function with optional key function

Example

max_val = UniCoreFW.max([1, 5, 3, 2, 4])

Expected output: 5

Source Code

def max(array, key_func=None): if not array: return None if key_func: return max(array, key=key_func) return max(array)