Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a Python program that calculates the average height and weight of students from a dictionary and categorizes them into Tall or Heavy based on
Write a Python program that calculates the average height and weight of students from a dictionary and categorizes them into "Tall" or "Heavy" based on specified thresholds. The original dictionary contains student names as keys and tuples with height (in feet) and weight (in kg) as values.
Your program should accomplish the following tasks:
1. Calculate the average height and weight of the students.
2. Prompt the user to enter thresholds for height and weight.
3. Categorize each student as "Tall" if their height is above the height threshold and "Heavy" if their weight is above the weight threshold.
4. Create two separate lists: one containing the names of tall students and another containing the names of heavy students.
5. Display the average height and weight, and the lists of tall and heavy students.
Note: comment each line of code to explain the code, otherwise Zero marks will be given.
Your program should accomplish the following tasks:
1. Calculate the average height and weight of the students.
2. Prompt the user to enter thresholds for height and weight.
3. Categorize each student as "Tall" if their height is above the height threshold and "Heavy" if their weight is above the weight threshold.
4. Create two separate lists: one containing the names of tall students and another containing the names of heavy students.
5. Display the average height and weight, and the lists of tall and heavy students.
Note: comment each line of code to explain the code, otherwise Zero marks will be given.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started