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

  When should events be used instead of loops

Modify the world to use an event instead of a loop to make the pterodactyl fly while the world is running. You might need to refer back to Chapter 3, which covers events.

  Different software packages to different departments

Did you explain how they would deploy different software packages to different departments?

  Questions how and why of at&t problems

Introduction-Include a brief introduction into the company and it's problem or situation.

  Calculate the amount of atp produced

Calculate the amount of ATP produced in each of the following catabolic processes. A. Glucose in the absence of oxygen B. Glucose in the presence of oxygen, all the way until the end of ETC/Ox. Phosphate C. Which is the most efficient process (mor..

  Devise a configuration management scheme

Devise a configuration management scheme for a small project (say, less than one person-year) and a large project (say, more than ten person-years). Give a rationale for the possible differences between those schemes.

  Compose a database in oracle

Name the three major set of files on disk that compose a database in Oracle.

  Computes the array b by computing the natural logarithm

Write a program that computes the array B by computing the natural logarithm of all the elements of A whose value is no less than 1, and adding 20 to all the other elements

  Generate an activity graph from that structure

You are about to bake a two-layer birthday cake with icing. Describe the cake-baking project as a work breakdown structure. Generate an activity graph from that structure. What is the critical path?

  Analyze use of databases in business environment

Create the 2-3 page memorandum analyzing use of databases in the business environment. Include what database applications must be used: Microsoft Access, IBM DB2, Oracle, etc.

  What is nanotechnology

What is nanotechnology? What are nano computers? How can nanotechnology and nanocomputing benefit us? How might it harm us? What kinds of ethic challenges do research in nanaotechnology and nanocomputing pose?

  How to extend the code generator for vardecl nodes

Some languages, including Java, require that all variables be initialized. Explain how to extend the code generator for VarDecl Nodes (Figure 12.3) so that both local and global variables are given a default initialization if no explicit initial v..

  Diiscuss their relationship to the quality

Define process maturity levels and discuss their relationship to the quality. (You might want to browse the SEI web site at www . sei . cmu. edu and related publications for references.)

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