1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Svetllana [295]
3 years ago
7

Write a function called missing_letters that takes a string parameter and returns a new string with all the letters of the alpha

bet that are not in the argument string. The letters in the returned string should be in alphabetical order. Your implementation should use a histogram from the histogram function. It should also use the global variable alphabet. It should use this global variable directly, not through an argument or a local copy. It should loop over the letters in alphabet to determine which are missing from the input parameter.
Computers and Technology
1 answer:
kompoz [17]3 years ago
6 0

A string parameter and returns new string with all the letters of the alphabet that are not in the argument string. The letters in the returned string should be in alphabetical order. The implementation should uses a histogram from the histogram function

Explanation:

The below code is written in python :

alphabet = "abcdefghijklmnopqrstuvwxyz"

test_dups = ["zzz","dog","bookkeeper","subdermatoglyphic","subdermatoglyphics"]

test_miss = ["zzz","subdermatoglyphic","the quick brown fox jumps over the lazy dog"]

def histogram(s):

   d = dict()

   for c in s:

       if c not in d:

           d[c] = 1

       else:

           d[c] += 1

   return d

def has_duplicates(s):

   for v in histogram(s).values():

       if v > 1:

           return True

   return False

def test_dups_loop():

   for s in test_dups:

       print(s + ':', has_duplicates(s))

def missing_letters(s):

   r = list('abcdefghijklmnopqrstuvwxyz')

   s = s.lower()

   for c in s.lower():

       if c in r:

           r.remove(c)  # the first matching instance

   return ''.join(r)

def test_miss_loop():

   for s in test_miss:

       print(s + ':', missing_letters(s))

def main():

   test_dups_loop()

   test_miss_loop()

if __name__ == '__main__':

   main()

You might be interested in
A _____ is usually a smaller version of a data warehouse
Strike441 [17]
A ( micro ) is usually a smaller version of a data warehouse
4 0
2 years ago
After purchasing new computers for her​ department, a manager is now comparing the performance of the new computers to the compu
AlladinOne [14]

Answer:

evaluation of decision effectiveness

Explanation:

Based on the information provided within the question it can be said that in this scenario she is in the stage of evaluation of decision effectiveness. This is the stage after the decision has been made in which the individual begins to analyze the decision and determine whether the decision was as effective as originally anticipated , and whether or not it was the correct decision.

8 0
2 years ago
Problem statement: Using loop, write a program that will ask the user to enter a character for left or right. Then, the user wil
zvonat [6]
Define variables
left is l
right is r

Ask input
left or right

Ask input value

Equate l or r to the input value

Show ladder with steps equal to input value and in the side of input variable
7 0
2 years ago
Matt Cooper of Soggy Bottom Canoe and Kayak Rental refers to concept testing as​ _____ testing.
andrezito [222]

Answer:

Beta

Explanation:

Beta testing is a Quality Assurance process, where Developers and testers evaluate the quality of application experience from the point of view of the users, who are the most important targets of any software product.

5 0
3 years ago
Draw a flowchart or write pseudocode to represent the logic of a program that allows the user to enter a value. the program divi
neonofarm [45]

Pseudocode

<span> Start <span> input myNumber <span> set myAnswer = myNumber / 2 output myAnswer <span> stop <span>Pseudocode is a computer programming language that resembles plain English and compiled or process into the computer. It explains the solution of the problem. Sometimes used as a detailed step by step process in developing a program</span></span></span></span></span>
8 0
2 years ago
Other questions:
  • Which shortcut brings up the Print screen?
    10·2 answers
  • How do you use a Hard Drive
    5·2 answers
  • Susie works for an architectural firm and the partners have always drawn the plans for projects by hand. Though Susie learned ho
    8·1 answer
  • Chandra, a student working on a group project, is trying to decide how to have the whole group suggest revisions for an essay. S
    10·1 answer
  • Circular error are caused by adding the cell name of a/an cell to aformula
    7·1 answer
  • "A user reports that the corporate web server cannot be accessed. A technician verifies that the web server can be accessed by i
    8·1 answer
  • Many Web browsers allow users to open anonymous windows. During a browsing session in an anonymous window, the browser does not
    8·1 answer
  • When you pass an argument to a method, the argument's data type must be ____________ with the receiving parameter's data type?
    11·1 answer
  • In which of the following scenarios would you choose to embed versus import data?
    8·1 answer
  • The Table Design and Layout tabs are available under the
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!