t = ['this', 'that', ['other']]

def capitalize_nested(t):
    res = []
for s in t:
    if type(s) == list:
        res.append(capitalize_nested(s))
else:
    res.append(s.capitalize())
return res
print(capitalize_nested(t))
Function that takes a nested list of strings and returns a new nested list with all strings capitalized?