Question: How to do this question using sum() method? Complete the get_average_word_length() function that takes a single string parameter sentence. This string consists of 1 or

 How to do this question using sum() method? Complete the get_average_word_length()

How to do this question using sum() method?

Complete the get_average_word_length() function that takes a single string parameter sentence. This string consists of 1 or more words, where words are separated with one or more spaces. The function should return the average word length rounded to the nearest 2 decimal places. Some examples of the function being called are shown below. For example: Test Result Average word length: 3.2 sentence = "a happy dog ate food" print("Average word length:", get_average_word_length(sentence)) science major" Average word length: 5.8; sentence = "computer science is the most interesting print("Average word length:", get_average_word_length(sentence))

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!