This is a simple Python program that converts numbers into their English word representation.
For example:
42
βforty two
317
βthree hundred and seventeen
- Converts numbers from 0 to 999 into words.
- Handles user input interactively.
- Displays helpful error messages for invalid inputs.
- Option to exit the program by typing
exit
.
project/
|ββ src/
βββ constants.py # Stores word mappings for numbers
βββ number2word.py # Main program (converter logic and CLI)
- Clone this repository or download the files.
- Make sure you have Python 3 installed.
- Run the program in your terminal:
python src/number2word.py
- Enter a number and see the output in words.
- Type
exit
to quit.
- Only supports numbers from 0 to 999.
- Negative numbers are not supported.