You are on page 1of 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