Created
May 23, 2021 03:25
-
-
Save baileywickham/a07c2babd4daa89ffdec10ca7c854113 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _max(values, func=None): | |
if not func: | |
return max(values) | |
maybeMax = values[0] | |
for v in values: | |
if func(v, maybeMax): | |
maybeMax = v | |
return maybeMax |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment