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
Which of the following is a valid IP address that can be used on the Internet (meaning the public addressing scheme)? Group of a
VladimirAG [237]

Answer:

168.16.1.1 is correct.

Explanation:

168.16.1.1 is the legitimate Internet Protocol address that can be used on the Internet.

Internet Protocol 10.10.1.1 and internet Protocol 172.30.1.1 are the private internet protocol addresses so they could not be used on the internet.

The Internet Protocol 234.1.1.1 has been used as a multicast address so they may not be used on the Internet.

7 0
3 years ago
Define the terms candidate key and primary key. Explain the difference between a primary key and a candidate key.
Shkiper50 [21]

Explanation:

Both Primary Key and Candidate Key are the attributes that are used to access tuples from a table. These (Primary key and Candidate key) are also can be used to create a relationship between two tables.

  • A Candidate Key can be any column or a combination of columns that can qualify as a unique key in the database. Each Candidate Key can qualify as a Primary Key.
  • A Primary Key is a column or a combination of columns that uniquely identify a record. The primary key is a minimal super key, so there is one and only one primary key in any relationship.

<em> The main difference between them is that a primary key is unique but there can be many candidate keys. </em>

I hope you find this information useful and interesting! Good luck!

5 0
3 years ago
patty works at Mcdonald's as a chef. it is her job to make hamburgers as each order arrives on her computer screen. one day patt
il63 [147K]
Angela should make sure the hamburger patty is disposed of and a new one prepared for the hamburger. She should reprimand Patty as what she did is wrong. Patty could well be fired for what she did. It is unsafe and unsanitary to give a customer food that has fallen on the floor. Angela should make sure this never happens again.

4 0
2 years ago
Read 2 more answers
You plan to use the Fill Down feature on a formula and you need to keep a cell reference the same. Which one of the following fo
viva [34]
You have to use this format for example $A$2
The format for absolute reference is designated with a dollar sign ($). If both column and, put a dollar sign before and in between the row and column. By doing this, column and row do not change when copied.
3 0
3 years ago
How do I change my age on here?-<br> Why did it set it to 18???
zvonat [6]

Answer:

lol

Explanation:

go to edit profile

6 0
3 years ago
Read 2 more answers
Other questions:
  • How can you make a circle in JavaScript? Thank you!
    9·1 answer
  • Taken together, the physical and data link layers are called the ____________________. Internet layer Hardware layer Internetwor
    15·1 answer
  • What is not true about contracts?
    12·2 answers
  • The Solution Explorer window ____.
    15·1 answer
  • Can you help me, please
    10·1 answer
  • Ou have recently issued new mobile phones to the sales team in your company. Each phone has the ability to store and transmit en
    14·1 answer
  • An app ________ is a website that provides access to specific mobile apps that can be downloaded either for a nominal fee or fre
    14·1 answer
  • Which of these problems is correct if the numbers are binary numbers?Group of answer choices1 + 1 = 21 + 1 = 100 + 0 = 11 + 0 =
    14·1 answer
  • What is the decimal number 86 when written as a
    9·1 answer
  • Which window would show you bindings for local area connection 2?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!