Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

check for that , you need to redact the number if all of those conditions were True . As stated above , you can't use replace . You will need ....

Need help with the last function in the HW. 

count_word:

Any help is much appreciated.

Thanks!

check for that , you need to redact the number if all of those conditions were True . As stated above ,you can't use replace . You will need ."LIME = SLICE UP to number +' XXX - XXX - XXXX' + SLICE after number*redact FILE : This function takes a string filename . It writes a new file that has the same contentsas the argument , except that all of the phone numbers are redacted . Assume that the filename has only*one period in it . The new filename is the same as the original with " redactEd ' added before theperiod . For instance , if the input filename were ' my File . Ext ' , the output filename would be" my FILE redacted . Ext ' . Make sure you close your output file .highlight : This function takes two string arguments . The first is a filename and the second is akeyword to be searched for in the file . Whenever a line is found that contains the keyword , print theline number followed by a colon left justified in a field of width 5 , followed by the line with everyoccurrence of the keyword bracketed by ' _ _ _ " on the left and " _ _ _ ' on the right . SEEhighlight in . txt and the test for an example of how this should work .Plagiarism . This Boolean function takes two filenames . If any line occurs in both files , return True.If not , return False . I suggest using nested loops . With nested loops , we call the loop that is in thebody of the other loop , the " inner loop* " . The loop that contains the inner loop is the " outer loop* "*Open the second file inside the outer loop*For LinEl in FiLEL :`FILE ? = OPEN ( Fname ? )For LINE ? in FILE? :Python only lets you read the file once per open , so you need this order of instructions . Make sure yourreturn False is outside of both loops . Otherwise , you will only compare the first two lines of thefiles . Make sure you close the file that gets read repeatedly after the inner loop but still inside the outer*loopcount word : This function takes a filename and a keyword . Return the number of times the keywordoccurs in the file .
Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question