Write a function that counts the frequency with which words

Assignment Help Computer Engineering
Reference no: EM132173804

USING PYTHON

1- The following lower cases letter are written partly below the baseline:g,j,p,q,y. We say that these letter has a descender.Write a function named hasDescender () that returns a list of words in a string in which at least one letter has a descender.

A word should appear in the return list at least once, no matter how many letter in it have descenders and no matter how many times the word occurs in the input string.

You may assume that the input consists of only lower case letters and spaces. no punctuaction or upper case letters. the order in the return list doesnt matter.

input:a string s that consists of words ,separated by spaces and return: a list of words in s that contain at least one descender

2- Write a function named wordLenghts() that counts the frequency with which words of different lenght occur in an input file and then returns a dictionary that contains this information.it will take one parameter : a string that is the name of an input file that exist before wordLenghts is called. you may assume that the input file is in the current working directory.

Assume that the input file contains only lower case letters and endlines (no capital letter or punctuaction). Each occurence of a word in the input file should be counted.

Duplicate words should be counted twice, tripicals three tines and so on(word lenghts are keys and the count of the words of that lenght is the corresponding value.

Reference no: EM132173804

Questions Cloud

Display the student with the highest score and the student : Using Python (Find the two highest scores) Write a program that prompts the user to enter the number of students and their score.
Find the percentage who earn less : (a) Find the percentage who earn less than $27,228. (b) Find the percentage who earn more than $32,116.
Create a game of rock and a series of if statements : Create a game of Rock, Paper, Scissors using random import, a while loop, and a series of if statements.
Write a program that prompts the user to input a sequence : Write a program that prompts the user to input a sequence of words, the program then displays a list of unique words.
Write a function that counts the frequency with which words : Write a function named wordLenghts() that counts the frequency with which words of different lenght occur in an input file.
Create a script that uses the getframe function : Create a script that uses the following functions: getframe, movie and movie2avi to plot the following functions on the same figure.
Write a function that will perform a random walk of n steps : Using Python, consider you are standing at a street corner, in a city where the streets are laid out in a very regular grid pattern.
Create a program that takes the following codes : Create a program that takes the following codes from the sorting algorithms of bubble sort,selection sort and merge sort and measures the time of each algorithm
Write a program that randomly generates integers : Write a program that randomly generates 1000000 integers and sorts them using radix sort.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Write program that implements a login window with text field

Write a program with a graphical interface that implements a login window with text fields for the user name and password.

  Build a simulator that reads a memory trace and simulates

Your job is to build a simulator that reads a memory trace and simulates the action of a virtual memory system with a single level page table.

  Find the original sequence

A sequence is encoded using the Burrows-Wheeler transform. Given L = elbkkee, and index = 5 (we start counting from 1, not 0), find the original sequence.

  Write a subroutine to subtract two numbers in asc

What restrictions are to be imposed on the assembly language if a single-pass assembler is needed?

  List examples of action that might benefit from applying PKI

List three examples (other than those listed in the chapter) of everyday actions that might benefit from applying PKI.

  How many secret keys are needed if everyone trusts president

How many secret keys are needed if everyone trusts the president of the club? If a member needs to send a message to another member.

  Define the ietf approach achieved ascendancy

express advantages/disadvantages of open vs. proprietary approaches to developing Internet protocol standards.

  Design a basic arithmetic logic unit

159.233 Computer Architecture Assignment. Design a basic Arithmetic/Logic Unit (ALU) that operates on two 2-bit binary numbers a and b

  What is the period of the external signal

Assuming a 2 MHz counter clock frequency. what is the period of the external signal in Figure?

  Create your own simple program using a repetition structure

Create your own simple program using a repetition (i.e., Loop) structure. You decide the theme. Provide an overview (i.e., Program Design) of what your repetition structure is doing

  Write down a method definition to count

Write down a class declaration for a student that has String first, last, and middle names as data fields. Declare only the data members and a no-arg constructor.

  Face-to-face contact would be expected

Some though argue that non-verbal clues quite often inhibit, rather than enhance, communications. We get distracted by accents, appearance, mannerisms, dress-style etc, and do not pay sufficient attention to the message being delivered. If that is..

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