Question: Question 1. Write a function called word_count that takes a single argument, the text of a single chapter, and returns the number of words in

 Question 1. Write a function called word_count that takes a single

Question 1. Write a function called word_count that takes a single argument, the text of a single chapter, and returns the number of words in that chapter. Assume that words are separated from each other by spaces. Hint: Try the string method split and the function len. ]: def word_count(text): numbords = len(text.split() word_count(tale_chapters.column("Chapter text").item()) Question 2. Use the apply function on the table from before to create an array called chapter_lengths which contains the length of each chapter in tale_chapters ]: chapter_lengths chapter_lengths

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!