In [16]:
"""
An example to show numeronyms on the Five Laws of Library Science
"""

global fiveLaws

fiveLaws = [ "Books are for use", "Every book its reader", 
            "Every reader his book", "Save the time of the reader",
            "Library is a growing organism"]

def i18nify(law):
    yield law[0] + str((len(law)-2)) + law[-1]
    
def main():
    for law in fiveLaws:
        print law
        print(i18nify(law).next())
    
if __name__ == '__main__':
    main()


Books are for use
B15e
Every book its reader
E19r
Every reader his book
E19k
Save the time of the reader
S25r
Library is a growing organism
L27m

In [ ]: