The maximum of a list is the largest element that it contains. For example, the maximum of is 3, the maximum of is 4, and the maximum of is 1. The maximum of is defined to be 0.
Write a program that prints the maximum of every given list.
Define and use a recursive function
maximum(t)
that returns the maximum of a list .
Using the @ast@ package, you can extract the list encoded in a string with @t = ast.literal_eval(s)@.
The input consists of several lists of non-negative numbers.
Print the maximum of every given list.
Input
[] [1, 2, 3] [1, [2, 3], 4] [[[1]]]
Output
0 3 4 1