# embedding.py # Lillian Lee (LJL2@cornell.edu) # Feb 26, 2013 """ Demonstrate recursive counting of the embeddedness of a list""" def embed(input): """Returns: level of embedding of . Precondition: input is a list of strings or a string""" return 0 if type(input) != list else 1 + max(map(embed, input))