Question: Python Coding Homework 07 py- ClUsers' tettel Downloads Homework 07 py (3.7.2) File Edit Format Run Options Window Help this homework consists of 8 problems.
Homework 07 py- ClUsers' tettel Downloads Homework 07 py (3.7.2) File Edit Format Run Options Window Help this homework consists of 8 problems. The first 7 sk that you fill in a blank in the code below. The last probiem asked you to draw some conclusions from the data generated. ou should submit this py file with the blanks filled in. Problem 8 should be answered as a triple quoted comment after the code. PROBLEM 0, Put your name and assignment intormation here.l # The Bells # Edgar Allen Poe theBel1s HEAR the sledges with the bells, iver bells! hat a world of merriment their melody foretellst How they tinkle, tinkle, tinkle n the icy air of night! hile the stars, that oversprinkle 1 the heavens, seem to twinkle With a crystalline delight: Keeping time, time, time, n a sort of Runic rhyme, the tintinnabulation that so musically wells From the bells, bells, bells, bells, Bells, bells, bells-- Erom the jingling and the tinkling of the bells ear the mellow wedding bells, olden bells! What a world of happiness their harmony foretells Through the balmy air of night How they ring out their delight! rom the molten-golden notes, And all in tune, What a 1iquid ditty floats To the turtle-dove that listens, while she gloats On the moon! h, from out the sounding cells, what a gush of euphony voluminously wells! How it swells! 0 Type here to search n the clamor and the clangor of the bells! ear the tolling of the bells, ron bells! What a world of solemn thought their monody compels! In the silence of the night ow we shiver with affright t the melancholy menace of their tone! For every sound that floats From the rust within. their throats s a groan. And the people--ah, the people, hey that dwell up in the steeple, All alone, And who tolling, tolling, tolling In that muffled monotone, eel a glory in so rolling On the human heart a stone-- They are neither man nor woman, They are neither brute nor human, They are Ghouls: And their king it is who tolls: And he rolls, rolls, rol1s, Rolls A paean from the bells: And his merry bosom swells With the paean of the bells, And he dances, and he yells: Keeping time, time, time, In a sort of Runic rhyme, To the paean of the bells, f the bells: Keeping time, time, time, a sort of Runic rhyme, o the throbbing of the bells, Of the bells, bells, bells- To the sobbing of the bells: Keeping time, time, time s he knells, knells, knells, In a happy Runic rhyse, To the rolling of the bells, of the bells, bells, bells: the tolling of the bells, the bells, bells, bells, bells, Bells, bells, bells the moaning and the groaning of the bel1s O Type here to search Upbions Window Help nd give me silence, give me water, hope ive me the struggle, the iron, the volcanoes Let bodies cling like magnets to my body me quickly to my veins and to ny mouth Speak through my speech, and through my blood. import string def litCricFriend (wordList, text): The Literary Critic's Friend helps the humanities scholar by computing and returning the frequency with which specified words (wordList) appear in a body of text (text).Frequency is the sum of the number of tines that each word in wordlist occurs, divided by the number of words in the text. A word occurrence is the whole word, regardless of case, and excluding punctuation." PROBLEM 1. Write a string nethod call that lower cases all lower-cased text to a new variable nane PROBLEN 2. Write a string method call that replaces every s of the characters in text. One line of code. Rint: assign the m-dash )in the lover-cased text with a space( One 1ine of code PROBLEM 3. Write a string method call that splits text into a # list of words (after they have been lower-cased, and the t n-dashes removed) One line of code PROBLEx 4. Write a loop that creates a bew word list, using a string method to strip the words from the list created in Probien 3 : of all leading and trailing punctuation. Hint: the string library, which is inported above, contains a constant named punctuation Three 1ines of code. FROBLEx s. write a loop that sums the number of times that the # words in wordList occur in the list from Problem 4. Hint 1: you # can use t words in words.ist. Between three and tive lines of code.( t depends on your coding atyle various styles are o. a list nethod to do the counting. Hint 2: lower case the PROBLEM 6. Calculate the ratio of the sunber from Problem O Type here to search 0 DOLL F3 F4 F5 F6 F7 Esc F1 F2 T0M LHe 11st created in Problem 3 s of all leading and trailing punctuation. Hint: the string library, s which is imported above, contains a constant named punctuation. Three lines of code. # PROBLEM 5, rite a loop that sums the number of times that the t words in wordList occur in the list from Problem 4. Hint 1: you can use a list method to do the counting. Hint 2: oser case the words in wordList. Between three and five lines of code- depends on your coding style-various styles are oc.) PROBLEM 6, Calculate the ratio of the number from Problem and three lines of code. (It depends on your coding style 1 to the number of words in text. Return this ratio. Between one # various styles are..) # PROBLEM 7, call itcricFriend() four times to find the frequency t of the indefinite articles 'a and 'an' and the definite article # each function call, identifying what it is. ror example, it night 'the' in the two poems above. Print out the value returned by t >>> bel1sAAnFrequency 0.07265587064676617 (That is a made-up number.) Each function call takes one line. that Poe and Neruda use 'a' and 'an PROBLEM 8. Do the results show l differently? Do the results show that Poe and Ne ruda use 'the # differently? Put your answer to PROBLEN 8 here. 0 Type here to search F3 FA FS F6 Esc F1 F2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
