def get_max(my_list):
    m = None
for item in my_list:
    if isinstance(item, list):
        item = get_max(item)
if not m or m < item:
    m = item
return m
How to find maximum number in a 2d python list