A Python program that converts alphabetic characters in a 10-character telephone number (e.g., 1-800-FLOWERS) into their numeric equivalents, following the standard telephone keypad mappings.
- Input Validation: Ensures the input matches the
XXX-XXX-XXXXformat before proceeding. - Character Translation: Converts alphabetic characters to their numeric equivalents based on telephone keypad mappings:
A, B, C→2D, E, F→3G, H, I→4J, K, L→5M, N, O→6P, Q, R, S→7T, U, V→8W, X, Y, Z→9
- Seamless Output: Displays the translated telephone number in the same format.
- Python: Implements string manipulation and input validation to achieve translation.
- Open the Python Source file (
phoneNum_translate.py) in Visual Studio Code. - Run the project.
This project was developed for my python programming class.