Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

develop python program: def phoneNumber(letters): 1. Decoding Telephone Numbers (4 points) Some companies use letters to show their telephone numbers, inorder to make the numbers

develop python program:

def phoneNumber(letters):

1. Decoding Telephone Numbers (4 points)

Some companies use letters to show their telephone numbers, inorder to make the numbers easier to remember. For example, thetelephone number GET-LOAN corresponds to 438-5626. Sometimes,companies might use more than 7 letters in order to make thetranslated number more meaningful (e.g., CALL-HOME for 225-5466,with the extra letters ignored).

Complete the phoneNumber() function, which takes a single stringargument that consists of at least 7 capital letters. The functionreturns a new string containing just the digits of thecorresponding telephone number. For simplicity, we will assume thatthe user input consists solely of capital letters, with no digits,symbols, lowercase letters, or spaces. Use the InternationalStandard telephone keypad () to determine the letter-digitcorrespondences for your function.

Your function should only process the first 7 letters in a givenencoded telephone number. For clarity, insert a single dashcharacter ('-') after the third digit in the translated number.HINT: Start by defining a Python dictionary that maps letters todigits (use the link above to determine which letters map to whichdigits).

HINT: use the letters as your keys, and the digits as yourdictionary values. Do not simply use a series of if statements inyour program!

Step by Step Solution

3.40 Rating (156 Votes )

There are 3 Steps involved in it

Step: 1

Python version 36 Python program to decode telephone numbers from input string of letters def phoneN... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Auditing and Assurance services an integrated approach

Authors: Alvin a. arens, Randal j. elder, Mark s. Beasley

14th Edition

133081605, 132575957, 9780133081602, 978-0132575959

More Books

Students also viewed these Programming questions