Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The international standard letter/number mapping for telephones is: {A, B, C} ->

ID: 3885486 • Letter: T

Question

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

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 by python programming

Explanation / Answer

Ans:

def getNumber(string):

string_in_uppercase=string.upper()

if(string_in_uppercase='A' or string_in_uppercase='B' or string_in_uppercase='C'):

elif(string_in_uppercase='D' or string_in_uppercase='E' or string_in_uppercase='F')

elif(string_in_uppercase='G' or string_in_uppercase='H' or string_in_uppercase='I')

elif(string_in_uppercase='J' or string_in_uppercase='K' or string_in_uppercase='L')

elif(string_in_uppercase='M' or string_in_uppercase='N' or string_in_uppercase='O')

elif(string_in_uppercase='P' or string_in_uppercase='Q' or string_in_uppercase='R' or string_in_uppercase='S')

elif(string_in_uppercase='T' or string_in_uppercase='U' or string_in_uppercase='V')

elif(string_in_uppercase='W' or string_in_uppercase='X' or string_in_uppercase='Y' or string_in_uppercase='Z')

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote