Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The international standard letter/number mapping for telephones is: {A, B, C} -> 2 {D, E, F} -> 3 {G, H, I} -> 4 {J, K,
The international standard letter/number mapping for telephones is:
{A, B, C} -> 2
{D, E, F} -> 3
{G, H, I} -> 4
{J, K, L} -> 5
{M, N, O} -> 6
{P, Q, R, S} -> 7
{T, U, V} -> 8
{W, X, Y, Z} -> 9
Using Python write a function getNumber() that takes an upper case letter and returns the number according to the international standard above.
Write a test program that prompts the user to enter a phone number as a string. The input number may contain letters. The program translates a letter (uppercase or lowercase) to a digit and leaves all other characters intact.
Here are sample runs of the program:
Enter a string: 1-800-Flowers
1 -800 -3569377
Enter a string: 1800flowers
1800356937
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started