Question: Python Only # PROBLEM 1. Write a string method call that lower cases all # of the characters in text. One line of code. Hint:
# PROBLEM 1. Write a string method call that lower cases all # of the characters in text. One line of code. Hint: assign the # lower-cased text to a new variable name. # PROBLEM 2. Write a string method call that replaces every # m-dash '--') in the lower-cased text with a space (' '). # One line 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 # m-dashes removed). One line of code. # PROBLEM 4. Write a loop that creates a new word list, using a # string method to strip the words from the list created in Problem 3 # of all leading and trailing punctuation. Hint: the string library, # which is imported above, contains a constant named punctuation. # Three lines of code. # PROBLEM 5. 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 a list method to do the counting. Hint 2: lower case the # words in wordList. Between three and five lines of code. (It # depends on your coding style -- various styles are OK.) # PROBLEM 6. Calculate the ratio of the number from Problem 5 # to the number of words in text. Return this ratio. Between one # and three lines of code. (It depends on your coding style # various styles are ok.) # PROBLEM 7. Call litcricFriend() four times to find the frequency # of the indefinite articles 'a' and 'an' and the definite article
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
