0% found this document useful (0 votes)
30 views1 page

Python Lab Exercises

The document provides instructions for 4 Python lab exercises: 1. Write a program to calculate a person's BMI using their weight in pounds and height in inches by converting units and applying the BMI formula. 2. Write a program to calculate a student's GPA using the formula that averages the product of each subject's grade and credits by the total credits. 3. Write a program to calculate an employee's average daily work hours over a week given their hours each day, allowing floating point hour values like 7.5 hours. 4. Write a program to calculate the total distance traveled by a car over two time periods with different speeds, using a 24-hour time format.

Uploaded by

Salman Shareef
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views1 page

Python Lab Exercises

The document provides instructions for 4 Python lab exercises: 1. Write a program to calculate a person's BMI using their weight in pounds and height in inches by converting units and applying the BMI formula. 2. Write a program to calculate a student's GPA using the formula that averages the product of each subject's grade and credits by the total credits. 3. Write a program to calculate an employee's average daily work hours over a week given their hours each day, allowing floating point hour values like 7.5 hours. 4. Write a program to calculate the total distance traveled by a car over two time periods with different speeds, using a 24-hour time format.

Uploaded by

Salman Shareef
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Python Lab Exercises

1. A person wants to know his Body Mass Index (BMI). He knows his weight in pounds and
height in inches. The evaluator knows the formula for calculating BMI using the formula,

BMI = (weight in kilograms) / (height in m * height in m)

Help the person in finding his BMI by writing a program for him. (Use the conversion
formulae: 1 pound =0.4536 kilograms, 1 inch = 2.54 cms)

2. Being a student of VIT, Raj wants to calculate the GPA (Grade Point Average), which is
calculated using the formula,

Sum of product of grade obtained in each subject and its corresponding credits / total credits.

Assume that the student has three subjects in the semester.

3. A company wants its employees to work for 'X' hours on average per day in a week
(Monday to Friday). Given the number of hours worked by an employee on each day of a
week, write the Python code to compute the average number of hours worked by the
employee. Number of hours worked can be floating point values. For example, 7 hours 30
minutes is entered as 7.5 hours

4. Use 24 hour format to solve the problem. A car moves with a speed of 'x' km/h from 'h1'
hours, 'm1' minutes to 'h2' hours, 'm2' minutes and then with a speed of 'y' km/h from 'h3'
hours, 'm3' minutes to 'h4' hours and 'm4' minutes. Write the Python code to determine the
total distance covered by the car. For example, if x is 40, h1 is 6, m1 is 40, h2 is 7, m2 is 10
and y is 60, h3 is 7, m3 is 15, h4 is 8, m4 is 0 then the car has covered 65 km in the given
time.

You might also like