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
Spreadsheet feature that can be used to arrange data from highest to lowest based on average<br>​
Juliette [100K]

Answer:

RANK.AVG

Explanation:

Required

Arrange data in descending order based on average

The feature to do this is to use the RANK.AVG() function.

By default, the function will return the ranks of the selected data in descending order (i.e. from highest to lowest); though, the sort order can be changed to ascending order.

The syntax is:

=RANK.AVG (number, ref, [order])

Where

number \to The number to use as rank

ref \to The cell range

order \to 0 represents descending order while 1 represents ascending order

8 0
3 years ago
If a printer is not Wi-Fi capable, how can it be set up to provide the most reliable wireless printing
SCORPION-xisa [38]

Answer:

Well you can use bluetooth since it doesn’t require wifi and it would still work if your printing a file from your computer or your flash drive.

5 0
2 years ago
Read 2 more answers
A microwave is the only electric device in a 120-volt circuit. If the circuit has 7. 5 amps of current, what is the electric pow
sergij07 [2.7K]

The only electric appliance in a 120-volt circuit is a microwave. If the circuit has a 7. 5 amp current, the microwave's electric output is 900 watts.

<h3>Explain about the microwave's electric output?</h3>

As was previously said, 1000W is the most common microwave wattage . The real power usage of a 1000W microwave, or its average input wattage, is 1402.7W. In a microwave, it is always more important to pay attention to the input wattage than the output wattage.

The energy that can be used in a microwave to heat and cook food is represented by this number. Typically, the power output is expressed in Watts, for example, 900 Watts. The appliance's whole wattage consumption used to produce microwave energy is the input.

A microwave can consume anywhere from 600 to 1,000 watts (W) of power. When connected to a 120-volt outlet, microwaves draw roughly 10 amps. The largest influence on how much electricity your microwave uses over time is how frequently you use it.

To learn more about microwave's electric output refer to:

brainly.com/question/13943474

#SPJ4

4 0
1 year ago
-
gavmur [86]

Answer:

ur dad was born in 1991

Explanation:

so he ate my pucc

5 0
3 years ago
How is Boolean logic used in logic gates? Select three options.
tresset_1 [31]

Answer: It would be the last three

Explanation: just did it on edge and got 100%

8 0
2 years ago
Other questions:
  • The _______ number system allows digital devices to represent virtually any number simply by using 0s and 1s.â
    14·1 answer
  • A switch operates in the OSI reference model __________ layer and uses the __________ address to forward packets.
    8·1 answer
  • Your motherboard supports dual channeling and you currently have two slots used in channel a on the board; each module holds 1 g
    15·1 answer
  • If you press the Tab key when you're in in the last cell of a table,
    10·2 answers
  • "What is the concept of a computer implemented as part of a larger system that is typically designed around a limited set of spe
    13·1 answer
  • How do you think advances in processors affect corporations that discover the computers they purchased just a couple of years ag
    10·1 answer
  • Which of these methods can you use to insert a new row in a worksheet?
    11·1 answer
  • Who is big brain me or you
    14·1 answer
  • Create a Python program to solve a simple pay calculation.
    10·1 answer
  • Northern Trail Outfitters uses a custom object Invoice to collect customer payment information from an external billing system.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!