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
Select the correct answer.
Bess [88]

Answer:

equals operator...............

6 0
3 years ago
Describe two measures you can use to evaluate whether an attachment in a message is reliable to open.
meriva
<span>If a attachment is not reliable to open, terrible effects can happen, peradventure it may have a virus or even malware that can destroy a computers software. 

To avoid this and stay on the safe side, try the following:-

- Open it in protected view 
- Do not save the attachment on your computer 
- Look at the author and read the message carefully to make sure it is not biased. 
- Open it on a flash-drive </span>
8 0
3 years ago
Read 2 more answers
Write a family database program. Create a class to represent a person and to store references to the person’s mother, father, an
Gennadij [26K]

Do you go to BASIS?

Sorry I don't have an answer for you, but we have the same assignment in our AP Comp sci class.

Just wondering.

8 0
2 years ago
The user location is usually a city
castortr0y [4]
What do you mean but I think yes the user location is usually a city
4 0
3 years ago
The physical view of a database system refers to
tigry1 [53]

Answer:

C. how and where the data are physically arranged and stored.

Explanation:

The physical view as the name implies describes how and where the data are physically arranged in the database. This deals with the physical arrangement of data in the database. This user usually view the database in a logical way. e.g table. The physical arrangement is usually used by database specialists. There can be multiple logical view of a database but just a single view of the physical view.

8 0
3 years ago
Other questions:
  • How many times go you need to click the format painter button to apply copied formats to multiple paragraphs one right after the
    5·2 answers
  • Which of the following data recording procedures is best used for behaviors that have a clear ending and beginning, do not occur
    12·1 answer
  • Your search google for recipe for tonight dinner is an.example of ?​
    8·2 answers
  • According to the government, employees have a right to understand the risks associated with the materials they work with.
    15·1 answer
  • Indica si los elementos de las imagenes son una materia prima o un material elaborado
    12·1 answer
  • Customizable diagrams, including List, Process, and Cycle diagrams, are built into Word and can be found in
    7·1 answer
  • When you open a program, the hard drive
    7·1 answer
  • TOT al<br>Name TWO examples of these settings and utilities. (2)​
    12·1 answer
  • In which of the following stages of the development process is a team MOST likely to interview a potential user of an app?
    6·1 answer
  • an existing technology that would allow users to transfer images from the camera to the computer without connecting them
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!