subject

Write a program that asks the user to enter a 10 character telephone number in the format xxx-xxx-. the application should display the telephone number with any alphabetic characters that appeared in the original translated to their numeric equivalent. for example, if the user enters 555-get-food the application should display 555-438-3663.

def main():
#character string
numeric_phone=" "

#user inputs phone number
alpha_phone = input('enter 10-digit phone number: ')

digit_list = ["2", "3","4", "5", "6", "7", "8", "9", "0"]

for ch in alpha_phone:
if ch. isalpha():
ch = ch is upper()

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 09:30
What are the steps involved in accepting all the changes in a document? arrange these in order click edit. click accept or reject. click changes. click accept all.
Answers: 1
question
Computers and Technology, 22.06.2019 12:30
What characteristic of long period comets suggest they come directly from the oort cloud?
Answers: 2
question
Computers and Technology, 24.06.2019 10:10
Scanning the road can be thought of as a
Answers: 2
question
Computers and Technology, 24.06.2019 13:30
Write a program that uses a two-dimensional array to store the highest and lowest temperatures for each month of the year. the program should output the average high, average low, and the highest and lowest temper- atures for the year. your program must consist of the following functions: a. function getdata: this function reads and stores data in the two- dimensional array. b. function averagehigh: this function calculates and returns the average high temperature for the year. c. function averagelow: this function calculates and returns the aver- age low temperature for the year. d. function indexhightemp: this function returns the index of the highest high temperature in the array. e. function indexlowtemp: this function retur
Answers: 3
You know the right answer?
Write a program that asks the user to enter a 10 character telephone number in the format xxx-xxx-....
Questions
question
Physics, 11.09.2019 16:30
Questions on the website: 13722361