Project Euler: Problem 17

https://projecteuler.net/problem=17

If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total.

If all the numbers from 1 to 1000 (one thousand) inclusive were written out in words, how many letters would be used?

NOTE: Do not count spaces or hyphens. For example, 342 (three hundred and forty-two) contains 23 letters and 115 (one hundred and fifteen) contains 20 letters. The use of "and" when writing out numbers is in compliance with British usage.

First write a number_to_words(n) function that takes an integer n between 1 and 1000 inclusive and returns a list of words for the number as described above


In [223]:
def number_to_words(n):
    """Given a number n between 1-1000 inclusive return a list of words for the number."""
    
    
    #Create a dictionary to use throughout each if loop
    numbers = {1:"one", 2:"two", 3:"three", 4:"four",5:"five", 6:"six", 7:"seven", 8:"eight", 9:"nine",
    10:"ten", 11:"eleven", 12:"twelve", 13:"thirteen", 14:"fourteen", 15:"fifteen", 
    16:"sixteen", 17:"seventeen",18:"eighteen",19:"nineteen", 
    20:"twenty",30:"thirty", 40:"forty", 50:"fifty",60:"sixty",70:"seventy",80:"eighty",90:"ninety",
    100: "hundred", 1000:"thousand"}

    #empty array to hold strings of numbers and a counter variable
    a = []    
    s = n
    while s !=0:
        #convert number to string
        f = str(s)
        
        #Less than a hundred case
        if s <=20:
            a.append(numbers[s])
        if 20<s<30:
            a.append(numbers[20]+numbers[int(f[1])])
        if 30<s<40:
            a.append(numbers[30]+numbers[int(f[1])])
        if 40<s<50:
            a.append(numbers[40]+numbers[int(f[1])])  
        if 50<s<60:
            a.append(numbers[50]+numbers[int(f[1])])
        if 60<s<70:
            a.append(numbers[60]+numbers[int(f[1])])
        if 70<s<80:
            a.append(numbers[70]+numbers[int(f[1])])
        if 80<s<90:
            a.append(numbers[80]+numbers[int(f[1])])
        if 90<s<100:
            a.append(numbers[90]+numbers[int(f[1])])
            
        #Deals with 10s and hundreds
        if s == 30:
            a.append(numbers[s])
        if s == 40:
            a.append(numbers[s])
        if s == 50:
            a.append(numbers[s])
        if s == 60:
            a.append(numbers[s])
        if s == 70:
            a.append(numbers[s])
        if s == 80:
            a.append(numbers[s])
        if s == 90:
            a.append(numbers[s])
        if s == 100:
            a.append(numbers[1] + numbers[100])
        if s == 200:
            a.append(numbers[2] + numbers[100])
        if s == 300:
            a.append(numbers[3] + numbers[100])
        if s == 400:
            a.append(numbers[4] + numbers[100])
        if s == 500:
            a.append(numbers[5] + numbers[100])
        if s == 600:
            a.append(numbers[6] + numbers[100])
        if s == 700:
            a.append(numbers[7] + numbers[100])
        if s == 800:
            a.append(numbers[8] + numbers[100])
        if s == 900:
            a.append(numbers[9] + numbers[100])
        if s == 1000:
            a.append(numbers[1] + numbers[1000])
            
            
        #all these if loops go through by hundreds to add to the list 

        if 100<s<200:
            x = int(f[-2:])
            l = f[0]
            if x <=20:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[int(x)])
            if 20<x<30:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[20]+numbers[int(f[-1:])])
            if 30<x<40:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[30]+numbers[int(f[-1:])])
            if 40<x<50:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[40]+numbers[int(f[-1:])])  
            if 50<x<60:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[50]+numbers[int(f[-1:])])
            if 60<x<70:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[60]+numbers[int(f[-1:])])
            if 70<x<80:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[70]+numbers[int(f[-1:])])
            if 80<x<90:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[80]+numbers[int(f[-1:])])
            if 90<x<100:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[90]+numbers[int(f[-1:])])
            if x == 30:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 40:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 50:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 60:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 70:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 80:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 90:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])

        if 200<s<300:
            x = int(f[-2:])
            l = f[0]
            if x <=20:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[int(x)])
            if 20<x<30:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[20]+numbers[int(f[-1:])])
            if 30<x<40:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[30]+numbers[int(f[-1:])])
            if 40<x<50:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[40]+numbers[int(f[-1:])])  
            if 50<x<60:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[50]+numbers[int(f[-1:])])
            if 60<x<70:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[60]+numbers[int(f[-1:])])
            if 70<x<80:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[70]+numbers[int(f[-1:])])
            if 80<x<90:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[80]+numbers[int(f[-1:])])
            if 90<x<100:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[90]+numbers[int(f[-1:])])
            if x == 30:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 40:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 50:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 60:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 70:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 80:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 90:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])

                
                
        if 300<s<400:
            x = int(f[-2:])
            l = f[0]
            if x <=20:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[int(x)])
            if 20<x<30:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[20]+numbers[int(f[-1:])])
            if 30<x<40:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[30]+numbers[int(f[-1:])])
            if 40<x<50:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[40]+numbers[int(f[-1:])])  
            if 50<x<60:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[50]+numbers[int(f[-1:])])
            if 60<x<70:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[60]+numbers[int(f[-1:])])
            if 70<x<80:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[70]+numbers[int(f[-1:])])
            if 80<x<90:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[80]+numbers[int(f[-1:])])
            if 90<x<100:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[90]+numbers[int(f[-1:])])
            if x == 30:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 40:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 50:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 60:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 70:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 80:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 90:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])

            

        if 400<s<500:
            x = int(f[-2:])
            l = f[0]
            if x <=20:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[int(x)])
            if 20<x<30:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[20]+numbers[int(f[-1:])])
            if 30<x<40:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[30]+numbers[int(f[-1:])])
            if 40<x<50:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[40]+numbers[int(f[-1:])])  
            if 50<x<60:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[50]+numbers[int(f[-1:])])
            if 60<x<70:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[60]+numbers[int(f[-1:])])
            if 70<x<80:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[70]+numbers[int(f[-1:])])
            if 80<x<90:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[80]+numbers[int(f[-1:])])
            if 90<x<100:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[90]+numbers[int(f[-1:])])
            if x == 30:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 40:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 50:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 60:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 70:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 80:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 90:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])

        if 500<s<600:
            x = int(f[-2:])
            l = f[0]
            if x <=20:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[int(x)])
            if 20<x<30:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[20]+numbers[int(f[-1:])])
            if 30<x<40:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[30]+numbers[int(f[-1:])])
            if 40<x<50:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[40]+numbers[int(f[-1:])])  
            if 50<x<60:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[50]+numbers[int(f[-1:])])
            if 60<x<70:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[60]+numbers[int(f[-1:])])
            if 70<x<80:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[70]+numbers[int(f[-1:])])
            if 80<x<90:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[80]+numbers[int(f[-1:])])
            if 90<x<100:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[90]+numbers[int(f[-1:])])
            if x == 30:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 40:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 50:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 60:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 70:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 80:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 90:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            

        if 600<s<700:
            x = int(f[-2:])
            l = f[0]
            if x <=20:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[int(x)])
            if 20<x<30:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[20]+numbers[int(f[-1:])])
            if 30<x<40:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[30]+numbers[int(f[-1:])])
            if 40<x<50:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[40]+numbers[int(f[-1:])])  
            if 50<x<60:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[50]+numbers[int(f[-1:])])
            if 60<x<70:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[60]+numbers[int(f[-1:])])
            if 70<x<80:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[70]+numbers[int(f[-1:])])
            if 80<x<90:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[80]+numbers[int(f[-1:])])
            if 90<x<100:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[90]+numbers[int(f[-1:])])
            if x == 30:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 40:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 50:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 60:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 70:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 80:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 90:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])

 
        if 700<s<800:
            x = int(f[-2:])
            l = f[0]
            if x <=20:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[int(x)])
            if 20<x<30:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[20]+numbers[int(f[-1:])])
            if 30<x<40:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[30]+numbers[int(f[-1:])])
            if 40<x<50:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[40]+numbers[int(f[-1:])])  
            if 50<x<60:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[50]+numbers[int(f[-1:])])
            if 60<x<70:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[60]+numbers[int(f[-1:])])
            if 70<x<80:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[70]+numbers[int(f[-1:])])
            if 80<x<90:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[80]+numbers[int(f[-1:])])
            if 90<x<100:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[90]+numbers[int(f[-1:])])
            if x == 30:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 40:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 50:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 60:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 70:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 80:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 90:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])

                
                
        if 800<s<900:
            x = int(f[-2:])
            l = f[0]
            if x <=20:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[int(x)])
            if 20<x<30:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[20]+numbers[int(f[-1:])])
            if 30<x<40:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[30]+numbers[int(f[-1:])])
            if 40<x<50:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[40]+numbers[int(f[-1:])])  
            if 50<x<60:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[50]+numbers[int(f[-1:])])
            if 60<x<70:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[60]+numbers[int(f[-1:])])
            if 70<x<80:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[70]+numbers[int(f[-1:])])
            if 80<x<90:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[80]+numbers[int(f[-1:])])
            if 90<x<100:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[90]+numbers[int(f[-1:])])
            if x == 30:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 40:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 50:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 60:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 70:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 80:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 90:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])

        if 900<s<1000:
            x = int(f[-2:])
            l = f[0]
            if x <=20:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[int(x)])
            if 20<x<30:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[20]+numbers[int(f[-1:])])
            if 30<x<40:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[30]+numbers[int(f[-1:])])
            if 40<x<50:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[40]+numbers[int(f[-1:])])  
            if 50<x<60:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[50]+numbers[int(f[-1:])])
            if 60<x<70:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[60]+numbers[int(f[-1:])])
            if 70<x<80:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[70]+numbers[int(f[-1:])])
            if 80<x<90:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[80]+numbers[int(f[-1:])])
            if 90<x<100:
                a.append(numbers[int(l)] + numbers[100]+"and" + numbers[90]+numbers[int(f[-1:])])
            if x == 30:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 40:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 50:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 60:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 70:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 80:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])
            if x == 90:
                a.append(numbers[int(l)] + numbers[100]+"and"+numbers[x])

            

            
        s -=1
    return a
print (number_to_words(1000))


['onethousand', 'ninehundredandninetynine', 'ninehundredandninetyeight', 'ninehundredandninetyseven', 'ninehundredandninetysix', 'ninehundredandninetyfive', 'ninehundredandninetyfour', 'ninehundredandninetythree', 'ninehundredandninetytwo', 'ninehundredandninetyone', 'ninehundredandninety', 'ninehundredandeightynine', 'ninehundredandeightyeight', 'ninehundredandeightyseven', 'ninehundredandeightysix', 'ninehundredandeightyfive', 'ninehundredandeightyfour', 'ninehundredandeightythree', 'ninehundredandeightytwo', 'ninehundredandeightyone', 'ninehundredandeighty', 'ninehundredandseventynine', 'ninehundredandseventyeight', 'ninehundredandseventyseven', 'ninehundredandseventysix', 'ninehundredandseventyfive', 'ninehundredandseventyfour', 'ninehundredandseventythree', 'ninehundredandseventytwo', 'ninehundredandseventyone', 'ninehundredandseventy', 'ninehundredandsixtynine', 'ninehundredandsixtyeight', 'ninehundredandsixtyseven', 'ninehundredandsixtysix', 'ninehundredandsixtyfive', 'ninehundredandsixtyfour', 'ninehundredandsixtythree', 'ninehundredandsixtytwo', 'ninehundredandsixtyone', 'ninehundredandsixty', 'ninehundredandfiftynine', 'ninehundredandfiftyeight', 'ninehundredandfiftyseven', 'ninehundredandfiftysix', 'ninehundredandfiftyfive', 'ninehundredandfiftyfour', 'ninehundredandfiftythree', 'ninehundredandfiftytwo', 'ninehundredandfiftyone', 'ninehundredandfifty', 'ninehundredandfortynine', 'ninehundredandfortyeight', 'ninehundredandfortyseven', 'ninehundredandfortysix', 'ninehundredandfortyfive', 'ninehundredandfortyfour', 'ninehundredandfortythree', 'ninehundredandfortytwo', 'ninehundredandfortyone', 'ninehundredandforty', 'ninehundredandthirtynine', 'ninehundredandthirtyeight', 'ninehundredandthirtyseven', 'ninehundredandthirtysix', 'ninehundredandthirtyfive', 'ninehundredandthirtyfour', 'ninehundredandthirtythree', 'ninehundredandthirtytwo', 'ninehundredandthirtyone', 'ninehundredandthirty', 'ninehundredandtwentynine', 'ninehundredandtwentyeight', 'ninehundredandtwentyseven', 'ninehundredandtwentysix', 'ninehundredandtwentyfive', 'ninehundredandtwentyfour', 'ninehundredandtwentythree', 'ninehundredandtwentytwo', 'ninehundredandtwentyone', 'ninehundredandtwenty', 'ninehundredandnineteen', 'ninehundredandeighteen', 'ninehundredandseventeen', 'ninehundredandsixteen', 'ninehundredandfifteen', 'ninehundredandfourteen', 'ninehundredandthirteen', 'ninehundredandtwelve', 'ninehundredandeleven', 'ninehundredandten', 'ninehundredandnine', 'ninehundredandeight', 'ninehundredandseven', 'ninehundredandsix', 'ninehundredandfive', 'ninehundredandfour', 'ninehundredandthree', 'ninehundredandtwo', 'ninehundredandone', 'ninehundred', 'eighthundredandninetynine', 'eighthundredandninetyeight', 'eighthundredandninetyseven', 'eighthundredandninetysix', 'eighthundredandninetyfive', 'eighthundredandninetyfour', 'eighthundredandninetythree', 'eighthundredandninetytwo', 'eighthundredandninetyone', 'eighthundredandninety', 'eighthundredandeightynine', 'eighthundredandeightyeight', 'eighthundredandeightyseven', 'eighthundredandeightysix', 'eighthundredandeightyfive', 'eighthundredandeightyfour', 'eighthundredandeightythree', 'eighthundredandeightytwo', 'eighthundredandeightyone', 'eighthundredandeighty', 'eighthundredandseventynine', 'eighthundredandseventyeight', 'eighthundredandseventyseven', 'eighthundredandseventysix', 'eighthundredandseventyfive', 'eighthundredandseventyfour', 'eighthundredandseventythree', 'eighthundredandseventytwo', 'eighthundredandseventyone', 'eighthundredandseventy', 'eighthundredandsixtynine', 'eighthundredandsixtyeight', 'eighthundredandsixtyseven', 'eighthundredandsixtysix', 'eighthundredandsixtyfive', 'eighthundredandsixtyfour', 'eighthundredandsixtythree', 'eighthundredandsixtytwo', 'eighthundredandsixtyone', 'eighthundredandsixty', 'eighthundredandfiftynine', 'eighthundredandfiftyeight', 'eighthundredandfiftyseven', 'eighthundredandfiftysix', 'eighthundredandfiftyfive', 'eighthundredandfiftyfour', 'eighthundredandfiftythree', 'eighthundredandfiftytwo', 'eighthundredandfiftyone', 'eighthundredandfifty', 'eighthundredandfortynine', 'eighthundredandfortyeight', 'eighthundredandfortyseven', 'eighthundredandfortysix', 'eighthundredandfortyfive', 'eighthundredandfortyfour', 'eighthundredandfortythree', 'eighthundredandfortytwo', 'eighthundredandfortyone', 'eighthundredandforty', 'eighthundredandthirtynine', 'eighthundredandthirtyeight', 'eighthundredandthirtyseven', 'eighthundredandthirtysix', 'eighthundredandthirtyfive', 'eighthundredandthirtyfour', 'eighthundredandthirtythree', 'eighthundredandthirtytwo', 'eighthundredandthirtyone', 'eighthundredandthirty', 'eighthundredandtwentynine', 'eighthundredandtwentyeight', 'eighthundredandtwentyseven', 'eighthundredandtwentysix', 'eighthundredandtwentyfive', 'eighthundredandtwentyfour', 'eighthundredandtwentythree', 'eighthundredandtwentytwo', 'eighthundredandtwentyone', 'eighthundredandtwenty', 'eighthundredandnineteen', 'eighthundredandeighteen', 'eighthundredandseventeen', 'eighthundredandsixteen', 'eighthundredandfifteen', 'eighthundredandfourteen', 'eighthundredandthirteen', 'eighthundredandtwelve', 'eighthundredandeleven', 'eighthundredandten', 'eighthundredandnine', 'eighthundredandeight', 'eighthundredandseven', 'eighthundredandsix', 'eighthundredandfive', 'eighthundredandfour', 'eighthundredandthree', 'eighthundredandtwo', 'eighthundredandone', 'eighthundred', 'sevenhundredandninetynine', 'sevenhundredandninetyeight', 'sevenhundredandninetyseven', 'sevenhundredandninetysix', 'sevenhundredandninetyfive', 'sevenhundredandninetyfour', 'sevenhundredandninetythree', 'sevenhundredandninetytwo', 'sevenhundredandninetyone', 'sevenhundredandninety', 'sevenhundredandeightynine', 'sevenhundredandeightyeight', 'sevenhundredandeightyseven', 'sevenhundredandeightysix', 'sevenhundredandeightyfive', 'sevenhundredandeightyfour', 'sevenhundredandeightythree', 'sevenhundredandeightytwo', 'sevenhundredandeightyone', 'sevenhundredandeighty', 'sevenhundredandseventynine', 'sevenhundredandseventyeight', 'sevenhundredandseventyseven', 'sevenhundredandseventysix', 'sevenhundredandseventyfive', 'sevenhundredandseventyfour', 'sevenhundredandseventythree', 'sevenhundredandseventytwo', 'sevenhundredandseventyone', 'sevenhundredandseventy', 'sevenhundredandsixtynine', 'sevenhundredandsixtyeight', 'sevenhundredandsixtyseven', 'sevenhundredandsixtysix', 'sevenhundredandsixtyfive', 'sevenhundredandsixtyfour', 'sevenhundredandsixtythree', 'sevenhundredandsixtytwo', 'sevenhundredandsixtyone', 'sevenhundredandsixty', 'sevenhundredandfiftynine', 'sevenhundredandfiftyeight', 'sevenhundredandfiftyseven', 'sevenhundredandfiftysix', 'sevenhundredandfiftyfive', 'sevenhundredandfiftyfour', 'sevenhundredandfiftythree', 'sevenhundredandfiftytwo', 'sevenhundredandfiftyone', 'sevenhundredandfifty', 'sevenhundredandfortynine', 'sevenhundredandfortyeight', 'sevenhundredandfortyseven', 'sevenhundredandfortysix', 'sevenhundredandfortyfive', 'sevenhundredandfortyfour', 'sevenhundredandfortythree', 'sevenhundredandfortytwo', 'sevenhundredandfortyone', 'sevenhundredandforty', 'sevenhundredandthirtynine', 'sevenhundredandthirtyeight', 'sevenhundredandthirtyseven', 'sevenhundredandthirtysix', 'sevenhundredandthirtyfive', 'sevenhundredandthirtyfour', 'sevenhundredandthirtythree', 'sevenhundredandthirtytwo', 'sevenhundredandthirtyone', 'sevenhundredandthirty', 'sevenhundredandtwentynine', 'sevenhundredandtwentyeight', 'sevenhundredandtwentyseven', 'sevenhundredandtwentysix', 'sevenhundredandtwentyfive', 'sevenhundredandtwentyfour', 'sevenhundredandtwentythree', 'sevenhundredandtwentytwo', 'sevenhundredandtwentyone', 'sevenhundredandtwenty', 'sevenhundredandnineteen', 'sevenhundredandeighteen', 'sevenhundredandseventeen', 'sevenhundredandsixteen', 'sevenhundredandfifteen', 'sevenhundredandfourteen', 'sevenhundredandthirteen', 'sevenhundredandtwelve', 'sevenhundredandeleven', 'sevenhundredandten', 'sevenhundredandnine', 'sevenhundredandeight', 'sevenhundredandseven', 'sevenhundredandsix', 'sevenhundredandfive', 'sevenhundredandfour', 'sevenhundredandthree', 'sevenhundredandtwo', 'sevenhundredandone', 'sevenhundred', 'sixhundredandninetynine', 'sixhundredandninetyeight', 'sixhundredandninetyseven', 'sixhundredandninetysix', 'sixhundredandninetyfive', 'sixhundredandninetyfour', 'sixhundredandninetythree', 'sixhundredandninetytwo', 'sixhundredandninetyone', 'sixhundredandninety', 'sixhundredandeightynine', 'sixhundredandeightyeight', 'sixhundredandeightyseven', 'sixhundredandeightysix', 'sixhundredandeightyfive', 'sixhundredandeightyfour', 'sixhundredandeightythree', 'sixhundredandeightytwo', 'sixhundredandeightyone', 'sixhundredandeighty', 'sixhundredandseventynine', 'sixhundredandseventyeight', 'sixhundredandseventyseven', 'sixhundredandseventysix', 'sixhundredandseventyfive', 'sixhundredandseventyfour', 'sixhundredandseventythree', 'sixhundredandseventytwo', 'sixhundredandseventyone', 'sixhundredandseventy', 'sixhundredandsixtynine', 'sixhundredandsixtyeight', 'sixhundredandsixtyseven', 'sixhundredandsixtysix', 'sixhundredandsixtyfive', 'sixhundredandsixtyfour', 'sixhundredandsixtythree', 'sixhundredandsixtytwo', 'sixhundredandsixtyone', 'sixhundredandsixty', 'sixhundredandfiftynine', 'sixhundredandfiftyeight', 'sixhundredandfiftyseven', 'sixhundredandfiftysix', 'sixhundredandfiftyfive', 'sixhundredandfiftyfour', 'sixhundredandfiftythree', 'sixhundredandfiftytwo', 'sixhundredandfiftyone', 'sixhundredandfifty', 'sixhundredandfortynine', 'sixhundredandfortyeight', 'sixhundredandfortyseven', 'sixhundredandfortysix', 'sixhundredandfortyfive', 'sixhundredandfortyfour', 'sixhundredandfortythree', 'sixhundredandfortytwo', 'sixhundredandfortyone', 'sixhundredandforty', 'sixhundredandthirtynine', 'sixhundredandthirtyeight', 'sixhundredandthirtyseven', 'sixhundredandthirtysix', 'sixhundredandthirtyfive', 'sixhundredandthirtyfour', 'sixhundredandthirtythree', 'sixhundredandthirtytwo', 'sixhundredandthirtyone', 'sixhundredandthirty', 'sixhundredandtwentynine', 'sixhundredandtwentyeight', 'sixhundredandtwentyseven', 'sixhundredandtwentysix', 'sixhundredandtwentyfive', 'sixhundredandtwentyfour', 'sixhundredandtwentythree', 'sixhundredandtwentytwo', 'sixhundredandtwentyone', 'sixhundredandtwenty', 'sixhundredandnineteen', 'sixhundredandeighteen', 'sixhundredandseventeen', 'sixhundredandsixteen', 'sixhundredandfifteen', 'sixhundredandfourteen', 'sixhundredandthirteen', 'sixhundredandtwelve', 'sixhundredandeleven', 'sixhundredandten', 'sixhundredandnine', 'sixhundredandeight', 'sixhundredandseven', 'sixhundredandsix', 'sixhundredandfive', 'sixhundredandfour', 'sixhundredandthree', 'sixhundredandtwo', 'sixhundredandone', 'sixhundred', 'fivehundredandninetynine', 'fivehundredandninetyeight', 'fivehundredandninetyseven', 'fivehundredandninetysix', 'fivehundredandninetyfive', 'fivehundredandninetyfour', 'fivehundredandninetythree', 'fivehundredandninetytwo', 'fivehundredandninetyone', 'fivehundredandninety', 'fivehundredandeightynine', 'fivehundredandeightyeight', 'fivehundredandeightyseven', 'fivehundredandeightysix', 'fivehundredandeightyfive', 'fivehundredandeightyfour', 'fivehundredandeightythree', 'fivehundredandeightytwo', 'fivehundredandeightyone', 'fivehundredandeighty', 'fivehundredandseventynine', 'fivehundredandseventyeight', 'fivehundredandseventyseven', 'fivehundredandseventysix', 'fivehundredandseventyfive', 'fivehundredandseventyfour', 'fivehundredandseventythree', 'fivehundredandseventytwo', 'fivehundredandseventyone', 'fivehundredandseventy', 'fivehundredandsixtynine', 'fivehundredandsixtyeight', 'fivehundredandsixtyseven', 'fivehundredandsixtysix', 'fivehundredandsixtyfive', 'fivehundredandsixtyfour', 'fivehundredandsixtythree', 'fivehundredandsixtytwo', 'fivehundredandsixtyone', 'fivehundredandsixty', 'fivehundredandfiftynine', 'fivehundredandfiftyeight', 'fivehundredandfiftyseven', 'fivehundredandfiftysix', 'fivehundredandfiftyfive', 'fivehundredandfiftyfour', 'fivehundredandfiftythree', 'fivehundredandfiftytwo', 'fivehundredandfiftyone', 'fivehundredandfifty', 'fivehundredandfortynine', 'fivehundredandfortyeight', 'fivehundredandfortyseven', 'fivehundredandfortysix', 'fivehundredandfortyfive', 'fivehundredandfortyfour', 'fivehundredandfortythree', 'fivehundredandfortytwo', 'fivehundredandfortyone', 'fivehundredandforty', 'fivehundredandthirtynine', 'fivehundredandthirtyeight', 'fivehundredandthirtyseven', 'fivehundredandthirtysix', 'fivehundredandthirtyfive', 'fivehundredandthirtyfour', 'fivehundredandthirtythree', 'fivehundredandthirtytwo', 'fivehundredandthirtyone', 'fivehundredandthirty', 'fivehundredandtwentynine', 'fivehundredandtwentyeight', 'fivehundredandtwentyseven', 'fivehundredandtwentysix', 'fivehundredandtwentyfive', 'fivehundredandtwentyfour', 'fivehundredandtwentythree', 'fivehundredandtwentytwo', 'fivehundredandtwentyone', 'fivehundredandtwenty', 'fivehundredandnineteen', 'fivehundredandeighteen', 'fivehundredandseventeen', 'fivehundredandsixteen', 'fivehundredandfifteen', 'fivehundredandfourteen', 'fivehundredandthirteen', 'fivehundredandtwelve', 'fivehundredandeleven', 'fivehundredandten', 'fivehundredandnine', 'fivehundredandeight', 'fivehundredandseven', 'fivehundredandsix', 'fivehundredandfive', 'fivehundredandfour', 'fivehundredandthree', 'fivehundredandtwo', 'fivehundredandone', 'fivehundred', 'fourhundredandninetynine', 'fourhundredandninetyeight', 'fourhundredandninetyseven', 'fourhundredandninetysix', 'fourhundredandninetyfive', 'fourhundredandninetyfour', 'fourhundredandninetythree', 'fourhundredandninetytwo', 'fourhundredandninetyone', 'fourhundredandninety', 'fourhundredandeightynine', 'fourhundredandeightyeight', 'fourhundredandeightyseven', 'fourhundredandeightysix', 'fourhundredandeightyfive', 'fourhundredandeightyfour', 'fourhundredandeightythree', 'fourhundredandeightytwo', 'fourhundredandeightyone', 'fourhundredandeighty', 'fourhundredandseventynine', 'fourhundredandseventyeight', 'fourhundredandseventyseven', 'fourhundredandseventysix', 'fourhundredandseventyfive', 'fourhundredandseventyfour', 'fourhundredandseventythree', 'fourhundredandseventytwo', 'fourhundredandseventyone', 'fourhundredandseventy', 'fourhundredandsixtynine', 'fourhundredandsixtyeight', 'fourhundredandsixtyseven', 'fourhundredandsixtysix', 'fourhundredandsixtyfive', 'fourhundredandsixtyfour', 'fourhundredandsixtythree', 'fourhundredandsixtytwo', 'fourhundredandsixtyone', 'fourhundredandsixty', 'fourhundredandfiftynine', 'fourhundredandfiftyeight', 'fourhundredandfiftyseven', 'fourhundredandfiftysix', 'fourhundredandfiftyfive', 'fourhundredandfiftyfour', 'fourhundredandfiftythree', 'fourhundredandfiftytwo', 'fourhundredandfiftyone', 'fourhundredandfifty', 'fourhundredandfortynine', 'fourhundredandfortyeight', 'fourhundredandfortyseven', 'fourhundredandfortysix', 'fourhundredandfortyfive', 'fourhundredandfortyfour', 'fourhundredandfortythree', 'fourhundredandfortytwo', 'fourhundredandfortyone', 'fourhundredandforty', 'fourhundredandthirtynine', 'fourhundredandthirtyeight', 'fourhundredandthirtyseven', 'fourhundredandthirtysix', 'fourhundredandthirtyfive', 'fourhundredandthirtyfour', 'fourhundredandthirtythree', 'fourhundredandthirtytwo', 'fourhundredandthirtyone', 'fourhundredandthirty', 'fourhundredandtwentynine', 'fourhundredandtwentyeight', 'fourhundredandtwentyseven', 'fourhundredandtwentysix', 'fourhundredandtwentyfive', 'fourhundredandtwentyfour', 'fourhundredandtwentythree', 'fourhundredandtwentytwo', 'fourhundredandtwentyone', 'fourhundredandtwenty', 'fourhundredandnineteen', 'fourhundredandeighteen', 'fourhundredandseventeen', 'fourhundredandsixteen', 'fourhundredandfifteen', 'fourhundredandfourteen', 'fourhundredandthirteen', 'fourhundredandtwelve', 'fourhundredandeleven', 'fourhundredandten', 'fourhundredandnine', 'fourhundredandeight', 'fourhundredandseven', 'fourhundredandsix', 'fourhundredandfive', 'fourhundredandfour', 'fourhundredandthree', 'fourhundredandtwo', 'fourhundredandone', 'fourhundred', 'threehundredandninetynine', 'threehundredandninetyeight', 'threehundredandninetyseven', 'threehundredandninetysix', 'threehundredandninetyfive', 'threehundredandninetyfour', 'threehundredandninetythree', 'threehundredandninetytwo', 'threehundredandninetyone', 'threehundredandninety', 'threehundredandeightynine', 'threehundredandeightyeight', 'threehundredandeightyseven', 'threehundredandeightysix', 'threehundredandeightyfive', 'threehundredandeightyfour', 'threehundredandeightythree', 'threehundredandeightytwo', 'threehundredandeightyone', 'threehundredandeighty', 'threehundredandseventynine', 'threehundredandseventyeight', 'threehundredandseventyseven', 'threehundredandseventysix', 'threehundredandseventyfive', 'threehundredandseventyfour', 'threehundredandseventythree', 'threehundredandseventytwo', 'threehundredandseventyone', 'threehundredandseventy', 'threehundredandsixtynine', 'threehundredandsixtyeight', 'threehundredandsixtyseven', 'threehundredandsixtysix', 'threehundredandsixtyfive', 'threehundredandsixtyfour', 'threehundredandsixtythree', 'threehundredandsixtytwo', 'threehundredandsixtyone', 'threehundredandsixty', 'threehundredandfiftynine', 'threehundredandfiftyeight', 'threehundredandfiftyseven', 'threehundredandfiftysix', 'threehundredandfiftyfive', 'threehundredandfiftyfour', 'threehundredandfiftythree', 'threehundredandfiftytwo', 'threehundredandfiftyone', 'threehundredandfifty', 'threehundredandfortynine', 'threehundredandfortyeight', 'threehundredandfortyseven', 'threehundredandfortysix', 'threehundredandfortyfive', 'threehundredandfortyfour', 'threehundredandfortythree', 'threehundredandfortytwo', 'threehundredandfortyone', 'threehundredandforty', 'threehundredandthirtynine', 'threehundredandthirtyeight', 'threehundredandthirtyseven', 'threehundredandthirtysix', 'threehundredandthirtyfive', 'threehundredandthirtyfour', 'threehundredandthirtythree', 'threehundredandthirtytwo', 'threehundredandthirtyone', 'threehundredandthirty', 'threehundredandtwentynine', 'threehundredandtwentyeight', 'threehundredandtwentyseven', 'threehundredandtwentysix', 'threehundredandtwentyfive', 'threehundredandtwentyfour', 'threehundredandtwentythree', 'threehundredandtwentytwo', 'threehundredandtwentyone', 'threehundredandtwenty', 'threehundredandnineteen', 'threehundredandeighteen', 'threehundredandseventeen', 'threehundredandsixteen', 'threehundredandfifteen', 'threehundredandfourteen', 'threehundredandthirteen', 'threehundredandtwelve', 'threehundredandeleven', 'threehundredandten', 'threehundredandnine', 'threehundredandeight', 'threehundredandseven', 'threehundredandsix', 'threehundredandfive', 'threehundredandfour', 'threehundredandthree', 'threehundredandtwo', 'threehundredandone', 'threehundred', 'twohundredandninetynine', 'twohundredandninetyeight', 'twohundredandninetyseven', 'twohundredandninetysix', 'twohundredandninetyfive', 'twohundredandninetyfour', 'twohundredandninetythree', 'twohundredandninetytwo', 'twohundredandninetyone', 'twohundredandninety', 'twohundredandeightynine', 'twohundredandeightyeight', 'twohundredandeightyseven', 'twohundredandeightysix', 'twohundredandeightyfive', 'twohundredandeightyfour', 'twohundredandeightythree', 'twohundredandeightytwo', 'twohundredandeightyone', 'twohundredandeighty', 'twohundredandseventynine', 'twohundredandseventyeight', 'twohundredandseventyseven', 'twohundredandseventysix', 'twohundredandseventyfive', 'twohundredandseventyfour', 'twohundredandseventythree', 'twohundredandseventytwo', 'twohundredandseventyone', 'twohundredandseventy', 'twohundredandsixtynine', 'twohundredandsixtyeight', 'twohundredandsixtyseven', 'twohundredandsixtysix', 'twohundredandsixtyfive', 'twohundredandsixtyfour', 'twohundredandsixtythree', 'twohundredandsixtytwo', 'twohundredandsixtyone', 'twohundredandsixty', 'twohundredandfiftynine', 'twohundredandfiftyeight', 'twohundredandfiftyseven', 'twohundredandfiftysix', 'twohundredandfiftyfive', 'twohundredandfiftyfour', 'twohundredandfiftythree', 'twohundredandfiftytwo', 'twohundredandfiftyone', 'twohundredandfifty', 'twohundredandfortynine', 'twohundredandfortyeight', 'twohundredandfortyseven', 'twohundredandfortysix', 'twohundredandfortyfive', 'twohundredandfortyfour', 'twohundredandfortythree', 'twohundredandfortytwo', 'twohundredandfortyone', 'twohundredandforty', 'twohundredandthirtynine', 'twohundredandthirtyeight', 'twohundredandthirtyseven', 'twohundredandthirtysix', 'twohundredandthirtyfive', 'twohundredandthirtyfour', 'twohundredandthirtythree', 'twohundredandthirtytwo', 'twohundredandthirtyone', 'twohundredandthirty', 'twohundredandtwentynine', 'twohundredandtwentyeight', 'twohundredandtwentyseven', 'twohundredandtwentysix', 'twohundredandtwentyfive', 'twohundredandtwentyfour', 'twohundredandtwentythree', 'twohundredandtwentytwo', 'twohundredandtwentyone', 'twohundredandtwenty', 'twohundredandnineteen', 'twohundredandeighteen', 'twohundredandseventeen', 'twohundredandsixteen', 'twohundredandfifteen', 'twohundredandfourteen', 'twohundredandthirteen', 'twohundredandtwelve', 'twohundredandeleven', 'twohundredandten', 'twohundredandnine', 'twohundredandeight', 'twohundredandseven', 'twohundredandsix', 'twohundredandfive', 'twohundredandfour', 'twohundredandthree', 'twohundredandtwo', 'twohundredandone', 'twohundred', 'onehundredandninetynine', 'onehundredandninetyeight', 'onehundredandninetyseven', 'onehundredandninetysix', 'onehundredandninetyfive', 'onehundredandninetyfour', 'onehundredandninetythree', 'onehundredandninetytwo', 'onehundredandninetyone', 'onehundredandninety', 'onehundredandeightynine', 'onehundredandeightyeight', 'onehundredandeightyseven', 'onehundredandeightysix', 'onehundredandeightyfive', 'onehundredandeightyfour', 'onehundredandeightythree', 'onehundredandeightytwo', 'onehundredandeightyone', 'onehundredandeighty', 'onehundredandseventynine', 'onehundredandseventyeight', 'onehundredandseventyseven', 'onehundredandseventysix', 'onehundredandseventyfive', 'onehundredandseventyfour', 'onehundredandseventythree', 'onehundredandseventytwo', 'onehundredandseventyone', 'onehundredandseventy', 'onehundredandsixtynine', 'onehundredandsixtyeight', 'onehundredandsixtyseven', 'onehundredandsixtysix', 'onehundredandsixtyfive', 'onehundredandsixtyfour', 'onehundredandsixtythree', 'onehundredandsixtytwo', 'onehundredandsixtyone', 'onehundredandsixty', 'onehundredandfiftynine', 'onehundredandfiftyeight', 'onehundredandfiftyseven', 'onehundredandfiftysix', 'onehundredandfiftyfive', 'onehundredandfiftyfour', 'onehundredandfiftythree', 'onehundredandfiftytwo', 'onehundredandfiftyone', 'onehundredandfifty', 'onehundredandfortynine', 'onehundredandfortyeight', 'onehundredandfortyseven', 'onehundredandfortysix', 'onehundredandfortyfive', 'onehundredandfortyfour', 'onehundredandfortythree', 'onehundredandfortytwo', 'onehundredandfortyone', 'onehundredandforty', 'onehundredandthirtynine', 'onehundredandthirtyeight', 'onehundredandthirtyseven', 'onehundredandthirtysix', 'onehundredandthirtyfive', 'onehundredandthirtyfour', 'onehundredandthirtythree', 'onehundredandthirtytwo', 'onehundredandthirtyone', 'onehundredandthirty', 'onehundredandtwentynine', 'onehundredandtwentyeight', 'onehundredandtwentyseven', 'onehundredandtwentysix', 'onehundredandtwentyfive', 'onehundredandtwentyfour', 'onehundredandtwentythree', 'onehundredandtwentytwo', 'onehundredandtwentyone', 'onehundredandtwenty', 'onehundredandnineteen', 'onehundredandeighteen', 'onehundredandseventeen', 'onehundredandsixteen', 'onehundredandfifteen', 'onehundredandfourteen', 'onehundredandthirteen', 'onehundredandtwelve', 'onehundredandeleven', 'onehundredandten', 'onehundredandnine', 'onehundredandeight', 'onehundredandseven', 'onehundredandsix', 'onehundredandfive', 'onehundredandfour', 'onehundredandthree', 'onehundredandtwo', 'onehundredandone', 'onehundred', 'ninetynine', 'ninetyeight', 'ninetyseven', 'ninetysix', 'ninetyfive', 'ninetyfour', 'ninetythree', 'ninetytwo', 'ninetyone', 'ninety', 'eightynine', 'eightyeight', 'eightyseven', 'eightysix', 'eightyfive', 'eightyfour', 'eightythree', 'eightytwo', 'eightyone', 'eighty', 'seventynine', 'seventyeight', 'seventyseven', 'seventysix', 'seventyfive', 'seventyfour', 'seventythree', 'seventytwo', 'seventyone', 'seventy', 'sixtynine', 'sixtyeight', 'sixtyseven', 'sixtysix', 'sixtyfive', 'sixtyfour', 'sixtythree', 'sixtytwo', 'sixtyone', 'sixty', 'fiftynine', 'fiftyeight', 'fiftyseven', 'fiftysix', 'fiftyfive', 'fiftyfour', 'fiftythree', 'fiftytwo', 'fiftyone', 'fifty', 'fortynine', 'fortyeight', 'fortyseven', 'fortysix', 'fortyfive', 'fortyfour', 'fortythree', 'fortytwo', 'fortyone', 'forty', 'thirtynine', 'thirtyeight', 'thirtyseven', 'thirtysix', 'thirtyfive', 'thirtyfour', 'thirtythree', 'thirtytwo', 'thirtyone', 'thirty', 'twentynine', 'twentyeight', 'twentyseven', 'twentysix', 'twentyfive', 'twentyfour', 'twentythree', 'twentytwo', 'twentyone', 'twenty', 'nineteen', 'eighteen', 'seventeen', 'sixteen', 'fifteen', 'fourteen', 'thirteen', 'twelve', 'eleven', 'ten', 'nine', 'eight', 'seven', 'six', 'five', 'four', 'three', 'two', 'one']

In [172]:
answer = number_to_words(110)
assert answer[0] == "onehundredandten"
answer1 = number_to_words(1000)
assert answer1[0] == "onethousand"
answer2 = number_to_words(200)
assert answer2[0] == "twohundred"

In [ ]:
assert True # use this for grading the number_to_words tests.

Now define a count_letters(n) that returns the number of letters used to write out the words for all of the the numbers 1 to n inclusive.


In [239]:
def count_letters(n):
    """Count the number of letters used to write out the words for 1-n inclusive."""
    f = number_to_words(n)
    counter = 0
    sum = 0
    while counter !=n:
        sum += len(f[counter])
        counter +=1
    return sum

Now write a set of assert tests for your count_letters function that verifies that it is working as expected.


In [237]:
assert count_letters(1) == 3
assert count_letters(2) == 6
assert count_letters(100) == 864

In [ ]:
assert True # use this for grading the count_letters tests.

Finally used your count_letters function to solve the original question.


In [238]:
print (count_letters(1000))


21124

In [ ]:
assert True # use this for gradig the answer to the original question.