Your task is to calculate the average height of students in the class. You will gather...

90.2K

Verified Solution

Question

Programming

Your task is to calculate the average height of students in theclass. You will gather each of the student’s height and put it in alist. then you will throw out the shortest and tallest height totake care of any statistical anomalies. Then you will add theheights and divide by the number of student’s in the class.

Heights of Students in inches

Max=77
Josefine=67
Hannah=66
Mia=65
Ben=74
Kevin=70
Marie=64
Aidan=70

Steps On Python:

Declare a list to contain the heights in inches

Ask the user to input values

Add each value to the list

Use appropriate list function to find smallest object

Use appropriate list function to remove that smallest object

Use appropriate list function to find largest object

Use appropriate list function to remove that largest object

Use appropriate list function to add objects in the list,

Then Use appropriate list function to divide that amount by thenumber of objects in the list

Then print the objects and the average height of students in theclass.

Answer & Explanation Solved by verified expert
3.8 Ratings (575 Votes)
solutionCodes code screenshot code output screenshot areattached belowCODElist declarationheightsheightsconverting num into int and inputnumber of studentsnumintinputEnter the    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students