Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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 nothing comes in the IDLE shell. Any possible reasons? Problem given on first picture. Python. image text in transcribed
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David J. Auer

3rd Edition

0131986252, 978-0131986251

More Books

Students also viewed these Databases questions

Question

How do Dimensional Database Models differ from Relational Models?

Answered: 1 week ago

Question

What type of processing do Relational Databases support?

Answered: 1 week ago

Question

Describe several aggregation operators.

Answered: 1 week ago