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]
4 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]4 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
which scheduling algorithm allocate the CPU firt to the process that request the CPU first, (a) first come first serve,(b) short
stepladder [879]

Answer:

is correct answer

(a)first come first serve

Explanation:

8 0
3 years ago
Compare a Wi-Fi hotspot with a cybercafé.
erik [133]

Answer:

A WiFi Hotspot is a wireless internet connection that allows a computer, smartphone, or any other internet-enabled devices to connect to internet access points.

A cybercafe refers to any business place that allows people to access the internet usually within its premises after paying for connection access to connect to it.

Explanation:

3 0
3 years ago
Which XXX will prompt the user to enter a value greater than 10, until a value that is greater than 10 is actually input?
aleksley [76]

Answer:

b. (userInput < 10)

Explanation:

The piece of code that will accomplish this would be (userInput < 10). The code will first ask the user to "Enter a number greater than 10:" then it will compare the value of userInput to 10, if it is less than 10 it will redo the loop over and over again until the userInput is greater than 10. Once the userInput is greater than 10 it will break out of the do-while loop and continue whatever code is written under and outside the do-while loop

4 0
3 years ago
12. How many different documents can<br> you have open at one time?
uranmaximum [27]

Answer:

10 documents ^_^

Explanation:

I can open it at the same time on my laptop ●~●

3 0
4 years ago
Which agency motors the sale and registration of vehicles and vessels within the state
gogolik [260]

An agency which monitors the sale and registration of vehicles and vessels within the state is the department of highway safety and motor vehicles.

<h3>What is the department of highway safety and motor vehicles?</h3>

The department of highway safety and motor vehicles can be defined as a cabinet agency that is established and saddled with the responsibility of monitoring the sales and registration of automobile vehicles and vessels within the state of Florida in the United States of America.

In 1969, the defunct department of public safety and the department of motor vehicles were merged together under Governor Claude Kirk, as a single agency, which became known as the department of highway safety and motor vehicles

Read more on department of highway safety here: brainly.com/question/4805408

#SPJ1

Complete Question:

Which agency monitors the sale and registration of vehicles and vessels within the state?

6 0
1 year ago
Other questions:
  • In the lab, you used the filter box in Wireshark to remove traffic from port 3389. What is that port used for? What filter synta
    12·1 answer
  • What feature would be used to collect how many times users downloaded a product catalog?
    11·1 answer
  • How do you think engel would feel about computers information systems and the internet?
    14·2 answers
  • One out of how many people in the world has a Fac3book account?
    8·1 answer
  • ______________ helps you see how your document will appear on the paper. ​
    10·1 answer
  • In what way was the Ohio River Valley a factor in the French and Indian War? The Ohio River Valley was controlled by both France
    8·2 answers
  • By dividing the control plane from the data plane, SDN offers the flexibility to view the entire data plane infrastructure as a
    11·2 answers
  • Which of these countries has very strict cultural
    8·2 answers
  • Area Triangolo Rettangolo in c++
    6·1 answer
  • Why hand tools are important in repairing personal computer?​
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!