# # Name: CS 111 Course Staff # # lab3task3.py # def min_val(values): """ returns the smallest value in the list values parameter: values is a non-empty list """ if len(values) == 1: return values[0] else: min_in_rest = min_val(values[1:]) if values[0] < min_in_rest: return values[0] else: return min_in_rest # test function def test(): """ test function for min_val() """ test1 = min_val(['b', 'a', 'c']) print('test call 1 returns', test1) test2 = min_val([5, 10, 7, 15]) print('test call 2 returns', test2) test3 = min_val(['b', 'a', 'd', 'c']) print('test call 3 returns', test3) test4 = min_val([10]) print('test call 4 returns', test4)