Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python Only # PROBLEM 1. Write a string method call that lower cases all # of the characters in text. One line of code. Hint:

Python Only image text in transcribed
# 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

2nd Edition

0471180742, 978-0471180746

More Books

Students also viewed these Databases questions