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
Adam is writing a program that: 1) has the user guess a number, and 2) tells the user how many guesses it took to get the correc
NNADVOKAT [17]

Answer:

There are two ways in which programs ... count-controlled loops; condition-controlled loops ... Sometimes it is necessary for steps to iterate a specific number of times. ... A count-controlled loop is used when the number of iterations to occur is ... the variable 'count' is used to keep track of how many times the algorithm

Explanation:

5 0
2 years ago
Read 2 more answers
TCP will guarantee that your packets will arrive at the destination, as long as the connection is still established. True False
puteri [66]

Answer: True

Explanation: TCP(Transmission control protocol) is the protocol that is responsible for making the connection between the two hosts and then  they can share the data between them.

TCP guarantees that the data or data packets that are being sent from the source will be delivered to the host  in the same way as it was sent from source port. This mechanism ensure that there will be no data manipulation in the order of the data. TCP also has a relation with the IP for the functioning.Thus the given statement is true.

3 0
3 years ago
If the old and new systems are operated side by side until the new system has proven itself, this type of system conversion plan
stiks02 [169]

Answer:

True

Explanation:

5 0
2 years ago
The /tmp directory is a temporary directory and will not exist on a system at all times. True or False?
jeka94

Answer:

False.

Explanation:

The /tmp directory is a directory that contains files that are required temporarily and also for temporary storage of data.The data inside the /tmp directory gets deleted when the system boots or shuts down.Since the directory exists permanently the content inside it is temporary.

So we can conclude that the answer is False.

5 0
3 years ago
In a spreadsheet, what is text wrapping used for?
rodikova [14]

in a spreadsheet, the text wrapping is used for to automatically alter cell height so that it can give room or allow all of the text to fit inside.

<h3>What is the feature about?</h3>

The Excel wrap text feature is known to be one that can help a person to totally display longer text in a cell even without the cell overflowing or moving to other cells.

Note that, in a spreadsheet, the text wrapping is used for to automatically alter cell height so that it can give room or allow all of the text to fit inside.

Learn more about spreadsheet from

brainly.com/question/4965119

#SPJ11

4 0
1 year ago
Other questions:
  • The version of Windows that first provided networking capabilities was _____.
    12·2 answers
  • you are concerned with security at your company and want to implement a technology that requires no configuring on the users sid
    15·1 answer
  • In an AND truth table.
    7·1 answer
  • List at least three benefits of automated testing?
    13·1 answer
  • Mary feels confident managing Google Search campaigns and is interested in extending her marketing reach with the help of Google
    10·1 answer
  • All portions, to include subject, title, paragraphs, sub-paragraphs, graphics, tables, charts, and bullet statements, must be pr
    12·1 answer
  • What is computer. Write full form of mips​
    15·1 answer
  • Write a SELECT statement that returns three columns: EmailAddress, OrderID, and the order total for each customer. To do this, y
    14·1 answer
  • A digital designer might do computer animations for video games,<br> OA<br> True<br> OB<br> False
    12·2 answers
  • What is also known as computer Network?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!