Question: The skeleton code (starter file) for the problem is pasted below: def phoneNumber(letters): result = # ADD YOUR CODE HERE return result def loadEvents(filename):
The skeleton code (starter file) for the problem is pasted below:

def phoneNumber(letters): result = "" # ADD YOUR CODE HERE return result
def loadEvents(filename): events = {} # ADD YOUR CODE HERE return events
def timeline(events): # ADD YOUR CODE HERE return
# DO NOT modify or remove the code below! We will use it for testing.
if __name__ == "__main__": # Problem 1: Decoding Telephone Numbers ph = input("Enter the text to translate: ") print("The corresponding phone number is", phoneNumber(ph)) print()
# Problem 2: Displaying a Timeline From a File fn = input("Enter the name of the timeline data file: ") e = loadEvents(fn) print("Dictionary of events:", e) print() print("Your timeline is:") timeline(e) print()
Some companies use letters to show their telephone numbers, in order to make the numbers easier to remember. For example, the telephone number GET-LOAN corresponds to 438-5626. Sometimes, companies might use more than 7 letters in order to make the translated number more meaningful (e.g., CALL-HOME for 225-5466, with the extra letters ignored). Complete the phoneNumber) function, which takes a single string argument that consists of at least 7 capital letters. The function returns a new string containing just the digits of the corresponding telephone number. For simplicity, we will assume that the user input consists solely of capital letters, with no digits, symbols, lowercase letters, or spaces. Use the International Standard telephone keypad (
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
