You have to use a dictionnary/array. For example :
to_19= ['zero','one','two','three','four','five','six','seven','eight','nine'..'nineteen']
tens = ['twenty'...'ninety']
And you could generate the string of a number by doing, for example :
if len(str(number)) == 2 and number > 20:
word_number = tens[str(number)[0]]+' '+units[str(number)[0]]
You have to check if the last figure is not a zero and so on.. classic value checking.
It reminds a project euler challenge (problem 17).. you should try to find some solutions about it
Hope it helps