Descriptive Numeric String

Project #1

Introduction

Display an integer as a descriptive numeric string. For example:

InputDescriptive Numeric String
0zero
120one hundred and twenty
1024one thousand, and twenty four
23,567twenty three thousand, five hundred and sixty seven
2000345678two billion, three hundred and forty five thousand, six hundred and seventy eight
3,000,000,000,036three trillion, and thirty six

Requirements

a. loop until the users indicates to quit (enters an empty string?)
b. ask the user to enter a positive integer
c. display the integer's descriptive numeric string
d. allow commas in the user's input (see examples)
e. the allowed integer range is 0 to 1 less than 1 quadrillion (10**15 - 1)
f. test for errors in the user's input and display error messages
g. user input must be converted to an integer for processing (do not use the input string)
h. code the program so that it can be imported into another program and used
    use if __name__ == '__main__': for the user input and verification code
i. the main "work" function should be intToDescriptiveNumericString(n)

image missing

Follow On

1. print trillions, billions, ... hundreds on separate lines
2. Remove "and" but leave spaces in the output string
3. Remove commas from the output string
4. Allow negative integers as input

Project #2

Reverse project #1. Take an numeric string and convert it to a integer.