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
Need answer ASAP !!!!!
timofeeve [1]
It’s the third one I had the same question so it’s the third one
7 0
3 years ago
Can you just switch out routers?
lord [1]

You can use your own router instead.

<h3>Can the routers just be changed?</h3>
  • You may use your own router in its place, and there are several compelling reasons to do so: A better and more dependable connection could be provided via a new router.
  • Simply disconnect, remove, and configure the new router. This involves changing the network name and password as normal, as well as connecting an Ethernet connection from the router to the modem.
  • Most Internet service providers let you buy your own modem and router separately or a unit that includes both; the choice is yours. You can access the Internet with either choice. Be aware that if you acquire a combination device and one component breaks (such as the modem or router),

To learn more about router refer to:

brainly.com/question/24812743

#SPJ4

5 0
2 years ago
If you are recordng a singer who is performing to the prerecorded sound of an orchestra, what type of feed would you most likely
zloy xaker [14]
You would most likely use a mix-minus
8 0
4 years ago
What are the tools in creating an animation?
Darya [45]

I will list tools you can use

Flipaclip

Regular a flip book with a pen and lots of paper sheets

I prefer twelve frames per second

and more tools

Capcut

Kinemaster

And search up on your main brower for lots of more info hoped this prepped you up a bit!

3 0
2 years ago
Instructions
nalin [4]

Answer:

no noob

Explanation:

give 5 robuk first

4 0
3 years ago
Other questions:
  • Which device stores data only temporarily, and only when the computer is running?
    12·1 answer
  • Write a program that opens a text file and reads its contents into a queue of characters. The program should then dequeue each c
    11·1 answer
  • What can you learn at Udemy.com?
    11·1 answer
  • How do you delete a slide from your presentation after selecting it
    8·1 answer
  • State whether true or false.
    6·1 answer
  • There are many opportunities for unscrupulous people to break information system security. Of the five components in an informat
    6·2 answers
  • The code segment below is intended to randomly print one of the values 2, 4, 6, or 8 with equal probability.
    12·1 answer
  • What is the purpose of the operating systems management function
    5·1 answer
  • You just settled in for some study time at the local coffee shop, and you pause long enough to connect your smartphone to the Wi
    7·1 answer
  • You are dropping your friend back home after a night at the movies. From the car, she turns on the indoor lights in her home usi
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!