answer.
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
zavuch27 [327]
2 years ago
15

Write a function summarize_letters that receives a string and returns a list of tuples containing the unique letters and their f

requencies in the string. Test your function and display each letter with its frequency. Your function should ignore case sensitivity (that is, 'a' and 'A' are the same) and ignore spaces and punctuation. When done, write a statement that says whether the string has all the letters of the alphabet.
Computers and Technology
1 answer:
marysya [2.9K]2 years ago
3 0

Answer:

Explanation:

2nd part

def summarize_letters(string):

#Initializaing a empty dictionary

character_counter = {}

#converting all the characters to lowercase

string_lower = string.lower()

for i in string_lower:

#checking if the chacter presents in the dictionary then increase it by one and also to check if the character is alphabet

if i in character_counter and i.isalpha():

character_counter[i] = character_counter[i]+1

#checking if the character not present in the dictionary then assign 1

if i not in character_counter and i.isalpha():

character_counter[i] = 1

#converting the dictionary to list of tuples

list_of_tuples = [(k, v) for k, v in character_counter.items()]

return list_of_tuples

#3rd Part

#initializing a string of characters in alphabets

alphabets = 'a b b b b B A c e f g d h i j k B l m M n o p q r s P t u v w x y z'

print(summarize_letters(alphabets))

#importing the string module

import string

#pulling all the alphabets

alphabet = set(string.ascii_lowercase)

#checking if our hardcoded string has all the alphabets

if set(alphabets.lower()) >= alphabet:

print('The string ' +alphabets+' has all the letters in the alphabet ')

You might be interested in
A patient asks her doctor to send a copy of her records to another medical office. However, the records are not transmitted beca
bezimeni [28]
 This type of security failure is called WIN32K_SECURITY_FAILURE. <span> This indicates a </span>security failure was detected in win32k. <span>According to a new report issued by Dark Reading, there are a number of key </span>security failures<span> that cybercriminals take advantage of.</span>
5 0
2 years ago
Read 2 more answers
Use the loop invariant (I) to show that the code below correctly computes the product of all elements in an array A of n integer
NeTakaya

Answer:

Given Loop Variant P = a[0], a[1] ... a[i]

It is product of n terms in array

Explanation:

The Basic Step: i = 0, loop invariant p=a[0], it is true because of 'p' initialized as a[0].

Induction Step: Assume that for i = n - 3, loop invariant p is product of a[0], a[1], a[2] .... a[n - 3].

So, after that multiply a[n - 2] with p, i.e P = a[0], a[1], a[2] .... a[n - 3].a[n - 2].

After execution of while loop, loop variant p becomes: P = a[0], a[1], a[2] .... a[n -3].a[n -2].

for the case i = n-2, invariant p is product of a[0], a[1], a[2] .... a[n-3].a[n-2]. It is the product of (n-1) terms. In while loop, incrementing the value of i, so i=n-1

And multiply a[n-1] with p, i.e P = a[0].a[1].a[2].... a[n-2].

a[n-1]. i.e. P=P.a[n-1]

By the assumption for i=n-3 loop invariant is true, therefore for i=n-2 also it is true.

By induction method proved that for all n > = 1 Code will return product of n array elements.

While loop check the condition i < n - 1. therefore the conditional statement is n - i > 1

If i = n , n - i = 0 , it will violate condition of while loop, so, the while loop will terminate at i = n at this time loop invariant P = a[0].a[1].a[2]....a[n-2].a[n-1]

6 0
2 years ago
1. What should you do if your computer is shared by your entire family and you install a plugin that saves user names and passwo
Citrus2011 [14]

Explanation:

1 make sure only you know the password

2 having weak security on one browser is basically a doorway for someone to get into your network

7 0
1 year ago
Read 2 more answers
There are 10 red apples and 12 green apples in a basket. If Vinta randomly selects 3 apples from the basket, what is the probabi
denpristay [2]

Answer:

12/22

Explanation:

As there are 22 apples in total and 12 green it is 12/22.

5 0
2 years ago
The Vice President (VP) of Customer Support for Universal Containers has issued a mission statement that "We will empower our cu
elena-14-01-66 [18.8K]

Answer: The three most appropriate options are:

options C, D E

Explanation:

(1) Enabling customers to be emailed FAQs by accessing the interactive voice response 24 hours a day helps consultant achieve mission statement.

(2) Also, mobile devices should have the same support as desktops for mobile devices customer community and should be well optimized.

(3) Consultant will achieve mission statement if a central "Contact Us" page is created which provides access to all available channels.

3 0
2 years ago
Other questions:
  • Whoever helps me with these questions i will help them with the same number of questions in any subject: 1. As the operations ma
    14·1 answer
  • Brianna would like to use a small program within the database to simplify the complicated task of creating a report. She should
    13·1 answer
  • What does a sticky CTA do?
    9·2 answers
  • The ________ program displays graphics and loading screens during the boot process.
    8·1 answer
  • Marco makes $65,000 a year as a graphic designer. He makes a charitable donation of $1,000 each year. He also has $5,000 of busi
    12·2 answers
  • What are the advantages and disadvantages of using a very large memory cell size, say, W = 64 instead of the standard size W = 8
    15·1 answer
  • You are consulting for a trucking company that does a large amount ofbusiness shipping packages between New York and Boston. The
    5·1 answer
  • A computer has 4 GB of RAM of which the operating system occupies 512 MB. The processes are all 256 MB (for simplicity) and have
    11·1 answer
  • You are working on a documentation file userNotes.txt with some members of your software development team. Just before the file
    12·1 answer
  • Put the steps in order to produce the output shown below. Assume the indenting will be correct in the program.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!