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]
4 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]4 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
A time-saving strategy that helps define unfamiliar words involves using
yuradex [85]

The correct answer is A. Familiar words for clues

Explanation:

Finding unfamiliar words is common while reading, especially in texts that belong to a specific field such as medicine, technology, etc. This can be handled through multiple strategies such as using a dictionary, guessing the meaning of the word based on its parts, and using context clues.

In this context, one of the easiest and most time-saving strategy is the use of context clues that implies using the familiar words as clues to guess the meaning of an unfamiliar word. This is effective because in most cases the meaning of an unknown word can be determined using the context of the word or words around the unknown word. Also, this strategy takes little time because you only need to analyze the sentence or paragraph where the unknown word is. Thus, the time-saving strategy to define unfamiliar words involves using familiar words for clues.

6 0
3 years ago
Read 2 more answers
Ok so I usually don’t do this but I just need an answer , on Instagram a notification popped up while I was watching someone’s s
statuscvo [17]

Answer:

I think it was about cheaper ads on Instagram and how they are lowering their prices.

Explanation:

6 0
3 years ago
Read 2 more answers
In early PCs, a DIMM in any one of the DIMM slots could fill the 64-bit bus; therefore, each slot was called a(n) ______________
Svetach [21]

Answer:

The correct answer to the following question will be Option A (Bank).

Explanation:

  • Sometimes on a motherboard, the memory modules are grouped into different groups and that each group is named as a branch. Furthermore, the term "bank" may be used loosely to describe a basic computing data storage area. When the record is stored in the database it can be accessed at a specific time by the user.
  • Because the 486 is a 32-bit processor and a 30-pin SIMM is 8-bit, four SIMMs (8x4=32) is called a bank when installing memory on an 80486 processor computer; Install four 16 MB SIMMs when upgrading to 64 MB. 

Therefore, Option A is the right answer.

3 0
3 years ago
PowerPoint provides a wide variety of predefined shapes that can add visual insert to a slide true or false
lozanna [386]
PowerPoint provides a wide variety of shapes for visual inserts this is true
6 0
3 years ago
Read 2 more answers
What is a free and compatible alternative to the Microsoft Office Suite (word processing, spreadsheets, and calendars)?
Akimi4 [234]

Answer:

Open Office

Explanation:

Open Office may be regarded as an open source productivity tool which allows users to enjoy the ability to create and edit documents similar to Microsoft Word, create spreadsheet files and documents similar to Microsoft excel and Presentation tool similar to Microsoft PowerPoint. With the open source category of open office, it means it is a free software whereby users can enjoy these tools without having to purchase any user license. The other tools in the option such as Notepad, Lotus note do not posses all these functionality.

6 0
3 years ago
Other questions:
  • Which of the following filenames is acceptable on both Windows and Mac<br> operating systems?
    9·1 answer
  • What does the word tolerance mean in textiles?
    9·1 answer
  • Is cloud computing a hardware service used to keep computers working? True or False
    11·1 answer
  • Briefly explain the benefits and consequences of technology. //PLEASE ANSWER//
    9·1 answer
  • What do you click to move to the next cell in the row?
    7·1 answer
  • Which printout will result from the snippet of code?
    9·1 answer
  • List the various types of social media that have been covered in the tutorial. Mention the key purposes for which each media typ
    9·1 answer
  • Write an algorithm to check whether the given number is divisible by 2,3 and 6 or not​​
    9·1 answer
  • One of the following is NOT a type of Intellectual Property
    7·1 answer
  • How am i supposed to add subtitles to a video without have to waist money???
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!