Problem

Write a recursive Python function findMaxVal() that takes an input list of numbers and returns the maximum value stored the list. Do not use any max() function from any Python package. Your code should only contain if blocks and recursive function calls. Your function should return None if the input array is an empty list. For example,

findMaxVal([1,2,-3,4.5,2,-1])
4.5
findMaxVal([]) is None
True

Comments