Ask Question
2 February, 07:40

Write a functiongetNumber () that takes an upper case letter and returns thenumber 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 (uppercaseor lowercase) to a digit and leaves all other characters intact. Here are sample runs of the program:Enter a string: 1-800 - Flowers1 - 800 - 3569377Enter a string: 1800 flower

+2
Answers (1)
  1. 2 February, 09:30
    0
    Answer / Explanation:

    To properly answer this question, we will utilize the python programming language.

    The Python programming language is a general purpose and high level programming language. You can use Python for developing desktop GUI applications, websites and web applications. Also, it allows you to focus on core functionality of the application by taking care of common programming tasks.

    Now, moving forward to write the program, we have:

    def string_test (s):

    d={"UPPER_CASE":0, "LOWER_CASE":0}

    for c in s:

    if c. isupper ():

    d["UPPER_CASE"]+=1

    elif c. islower ():

    d["LOWER_CASE"]+=1

    else:

    pass

    print ("Original String : ", s)

    print ("No. of Upper case characters : ", d["UPPER_CASE"])

    print ("No. of Lower case Characters : ", d["LOWER_CASE"])

    string_test ('Enter Phone Number')
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write a functiongetNumber () that takes an upper case letter and returns thenumber according to the international standard above. Write a ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers