def find_max(arr): return max(arr)
- def find_max(arr):
return sorted(arr)[::-1][0]- return max(arr)
test.assert_equals(find_max([1, 2, 3, 4, 5]), 5) test.assert_equals(find_max([132, 22, 876, 492, -1]), 876) test.assert_equals(find_max([-7, 2.5, 4.123124, -20, 5.1]), 5.1)
# TODO: Replace examples and use TDD by writing your own tests# These are some of the methods available:# test.expect(boolean, [optional] message)# test.assert_equals(actual, expected, [optional] message)# test.assert_not_equals(actual, expected, [optional] message)# You can use Test.describe and Test.it to write BDD style test groupingstest.assert_equals(find_max([1, 2, 3, 4, 5]), 5)- test.assert_equals(find_max([1, 2, 3, 4, 5]), 5)
- test.assert_equals(find_max([132, 22, 876, 492, -1]), 876)
- test.assert_equals(find_max([-7, 2.5, 4.123124, -20, 5.1]), 5.1)