Question: I think I did this correct, but when I run it its giving me errors. At the bottom I typed wordAverage(s) to execut it, but

5. Word average. Write a program that averages length of the words in a sentence. Call the program wordAverage. For example, if the user enters the sentence "The quick brown fox jumps over the lazy dog". initially the output should be 3.88888888889. Use string formatting to insure that the average is output centered in a space of 10 characters with 3 of those characters after the decimal. Allow the user to enter 3 different sentences. def wordAverage (S): E : return 0 else: Bum-0 flag-0 wento count=0 Cor 1 in 2 10 1!" and flag: flag-1 11!="" and flag: count-1 11 - and flag: flag=0 sums+count count- want 1 flag-ul: sums+count W cnt+1 avg"0.0 1w_ont! 0: avg-round ( (sums/w_ent), 3) 31=Input ("Enter 15 sentence: ") paint (E avetage: ", wordAverage (31) 52-input("Enter and sentence: ") print("Words average: ", wordAverage (2) 33nput/Enses rd sentence: ") princ Nord average: ", wordAverage (53)) wodAverage 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
