0

How do i find out the depth of an expression in python?The code i've written works well for inputs like [[1,2],[1,2,[3,6,54]] but not for ones like depth (['+', ['expt', 'x', 2], ['expt', 'y', 2]]) => 2 and depth(('/', ('expt', 'x', 5), ('expt', ('-', ('expt', 'x', 2), 1), ('/', 5, 2)))) => 4
...