Question: this is in python 3. please do both average and median process_book is the war and peace txt file call War_and_Peace_no_punc.txt from project gutenberg Q9:
this is in python 3. please do both average and median process_book is the war and peace txt file call War_and_Peace_no_punc.txt from project gutenberg
Q9: War and Peace. Part 2 Your challenge for this problem is to create a function process_book that takes in 2 arguments: book_name and mode. book_name: the string that is the name of the file to open mode: a string that is either "average" or "median" return: the "average" word length in the book or the "median" word length in the file, depending on the second argument. Hint: We got a median word length of 4 for War and Peace
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
