Function named wordcount that takes one parameter

Assignment Help Basic Computer Science
Reference no: EM131725548

Problem 1. function named wordCount that takes one parameter, wordList -- a list of words and return a dictionary in which each word in wordList is a key and the corresponding value is the number of times in wordList that word appears.

For example, the following is correct output

horton = ['I','say','what','I','mean','and','I','mean','what','I','say']

print(wordCount(horton))

{'I': 4, 'say': 2, 'what': 2, 'mean': 2, 'and': 1}

Problem 2. function named initialLetters that takes one parameter, wordList -- a list of words and return a dictionary in which each initial letter of a word in wordList is a key and the corresponding value is a list of the words in wordList that begin with that letter. There should be no duplicate words in any value in the dictionary.

For example, the following is correct output

print(initialLetters(horton))

{'i': ['I'], 's': ['say'], 'w': ['what'], 'm': ['mean'], 'a': ['and']}

Problem 3. function named shareALetter that takes one parameter, wordList -- a list of words and return a dictionary in which each word in wordList is a key and the corresponding value is a list of all the words in wordList that share at least one letter with that word. There should be no duplicate words in any value in the dictionary. 

For example, the following is correct output

print(shareALetter(horton))

{'I': ['I'], 'say': ['say', 'what', 'mean', 'and'], 'what': ['say', 'what', 'mean', 'and'], 'mean': ['say', 'what', 'mean', 'and'], 'and': ['say', 'what', 'mean', 'and']}

Reference no: EM131725548

Questions Cloud

What is the book value of the equipment at end of project : What is the book value of the equipment at the end of the project's useful life (Year 3)? Indicate your answer in the box.
Find the definition of variable ip routing : Read the MIB specification to find the definition of variable IP Routing Table that corresponds to an IP routing table. Design a program that will use SNMP.
Describe the it governance system : Describe the IT governance system that was in place at the University of Southeast using both decision rights and structures as the bases of governance.
Determine the break-even point for two machines : Determine the break-even point for one machine. Determine the break-even point for two machines.
Function named wordcount that takes one parameter : Problem 1. function named wordCount that takes one parameter, wordList -- a list of words and return a dictionary in which each word
Advantages and disadvantages of protocol translation : It is possible to translate some application protocols into others. For example, it might be possible to build a program that accepts an FTP request.
Annual ordering and holding costs for each inventory : What is the optimal order size and frequency for Ford? For GM? What is the annual ordering and holding costs for each inventory?
Design the EDS would you make any changes : Design the EDS, would you make any changes to the way the ship functioned? Why or why not? Explain your answer in three to five sentences including examples
What are the two most common http request types : What are the two most common HTTP request types (also known as request methods)?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Use the readline() method to obtain a value from the user

Write a code segment that will analyze a numeric value provided by the user to determine if he or she is a newborn, a child, a teenager, or an adult. Make sure to include the following in your code:

  Assignment overview and requirements

You have completed the course, and should now have the requisite understanding of how to apply the tools and methodology of Stage-Gate®. So, let's do it! You will be responsible for walking 7 widgets from the  stage, through the post launch review..

  Ways of getting employees to implement change

It is stated in the chapter that the three ways of getting employees to implement change are: Tell them what to do; Sell them on what must be done; and Involve them in determining the substance and direction of the change.

  Form of employee participation is important

Why or why not? If not, how would you go about trying to convince Mr. Rainer that some form of employee participation is important.

  Solve the maximum flow problem by the labeling algorithm

Specify the residual network before each augmentation. After every augmentation, decompose the flow into flows along directed paths from node s to node t. Finally, specify the minimum cut in the network obtained by the labeling algorithm.

  Winfield transportation system

Winfield is a small city with a population of 22,000. Until now, Winfield was served by a bus route from a nearby city.

  Find the average case complexity of sequential search

Find the average case complexity of sequential search in an array if the probability of accessing the last cell equals 1/2, the probability of the next to the last cell equals 1/4 .

  Main purposes of innovation portfolio management

Discuss what the main purposes of innovation portfolio management are. In your answer explain how creativity and innovation differ. Provide examples to illustrate your answer.

  Discuss the role of certificate authentication in e-commerce

Many predict that the future of e-commerce is pegged on the successful implementation of authentication. Discuss.

  Difference between in-place updating and shadowing

What is the difference between in-place updating and shadowing, with respect to their handling of BFIM and AFIM?

  Alter computation of prefix function-correctly match string

if ‘_' is wild-card, then pattern ‘foo*bar*nad' can be found in ‘foofoowangbarnad'. Alter computation of prefix function to correctly match strings using KMP.

  Example organizational buying process

Exhibit 3.1 describes an example organizational buying process. In your own words, describe the selling process for each step. In any given company, what persons or departments may be involved in the purchasing process?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd