Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python: Write a program in a file called averageLength.py This program asks the user for three strings and prints the average length of the strings

Python:
Write a program in a file called averageLength.py
This program asks the user for three strings and prints the average length of the strings entered.
Display only 2 digits after the decimal point.
HINT: the average of three numbers is computed by adding the three numbers and dividing the result by 3.
HINT: the length of a string is computed using the function len. Len("hello") return 5
Examples:
% python3 averageLength.py
enter first string: a
enter second string: b
enter third string: c
the average length is: 1.00
% python3 averageLength.py
enter first string: hello world
enter second string: hello world world
enter third string: hello hello world world
the average length is: 17.00
%

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

Step: 3

blur-text-image

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 Design Application Development And Administration

Authors: Michael V. Mannino

3rd Edition

0071107010, 978-0071107013

More Books

Students also viewed these Databases questions