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
bagirrra123 [75]
3 years ago
14

Create a dictionary named letter_counts that contains each letter and the number of times it occurs in string1. Challenge: Lette

rs should not be counted separately as upper-case and lower-case. Intead, all of them should be counted as lower-case.
Computers and Technology
1 answer:
Amanda [17]3 years ago
4 0

Answer:

  1. letter_counts = {}
  2. string1 = "I have a dream"
  3. string1 = string1.lower()
  4. for x in string1:
  5.    if(x == " "):
  6.        continue  
  7.    if x not in letter_counts:
  8.        letter_counts[x] = 1
  9.    else:
  10.        letter_counts[x] += 1
  11. print(letter_counts)

Explanation:

The solution is written in Python 3.

Firstly create a letter_count dictionary (Line 1)

Next, create a sample string and assign it to string1 variable and convert all the characters to lowercase using lower method (Line 4).

Create a for loop to traverse through each character in string1 and check if the current character is a single space, just skip to the next iteration (Line 7 -8). If the current character is not found in letter_counts dictionary, set the initial count value 1 to x property of letter_counts. Otherwise increment the x property value by one (Line 9 -12).

After completion of loop, print the letter_count dictionary. We shall get the sample output {'i': 1, 'h': 1, 'a': 3, 'v': 1, 'e': 2, 'd': 1, 'r': 1, 'm': 1}

You might be interested in
You receive an email that appears to legitimately be from your Bank. The email indicates the need for verification of your infor
anzhelika [568]

Answer:

phishing

Explanation:

6 0
3 years ago
Read 2 more answers
You browsing internet and you realize that its not responding what do you do with out rebooting the computer
Allisa [31]
You can try and turn wifi off then on press save on whatever you were doing if you can then reboot it. other then that theres not many more options.
4 0
3 years ago
What is internet?<br>what is online?​
slavikrds [6]

Answer:

internet: The Internet is a vast network that connects computers all over the world. Through the Internet, people can share information and communicate from anywhere with an Internet connection.

online: controlled by or connected to a computer., while connected to a computer or under computer control.

3 0
3 years ago
A customer struggles with the small print of most smartphones. The customer still likes the idea of using a smartphone for phone
aliya0001 [1]

Answer:

The answer is a phablet.

Explanation:

A phablet is a class of smartphones with an intermediate size between a smartphone and a tablet. If the customer follows the recommendation, then he could still use this device for phone calls and work and not struggle anymore with the small print of the typical smartphone.

3 0
3 years ago
Read 2 more answers
Some email programs let you use a ____ to move incoming mail to a specific folder or to delete it automatically based on the con
KatRina [158]

Answer:

filter

Explanation:

Some email programs let you use a filter to move incoming mail to a specific folder or to delete it automatically based on the content of the message.​

The filter performs this role by either automatically deleting or moving to another location.

Most messages that are moved or deleted are unsolicited emails or spam messages.

Filtering of your mails helps so you ou can manage your incoming mail using filters to send email to a label, or archive, delete, star, or automatically forward your mail.

This is a way of organising your correspondence.

6 0
3 years ago
Other questions:
  • If two cars got to a four way stop intersection at the same time which car should be yield the right-of- way
    12·1 answer
  • What is one example of technology influencing health​
    9·1 answer
  • Într-o curte sunt G găini și O oi. Să se determine numărul de capete și numărul de picioare din curte.
    13·1 answer
  • Knowing what you know about today’s video games, imagine what it would look like if you had to create a modern-day version of Sp
    6·1 answer
  • Write a program to read 10 integers from an input file and output the average, minimum, and maximum of those numbers to an outpu
    14·1 answer
  • Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integer
    11·1 answer
  • Write a program that produces an expense report for a trip to Lagos, Nigeria. Use the Internet to research the cost to travel to
    13·1 answer
  • Who's hype for Halo Infinite?
    11·2 answers
  • In the past, workers would usually complete ______. a. A variety of tasks on a daily basis b. The same tasks every day c. Thinki
    9·2 answers
  • Which of these is NOT an input device?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!