Practical 4
Practical 4
1
Aim-A year is a Leap year if it is divisible by 4, unless it is a century
year that is not divisible by 400 (1800 and 1900 are not leap years,
1600 and 2000 are leap years). Write a program that calculates
whether a given year is a leap year or not.
year=int(input("enter a year:"))
if(year%4==0 and year%100!=0)or(year%400==0):
print(year,"year is leap year.")
else:
print(year,"year is not leap year.")
output :-
Practical-4.2
Aim-Many companies pay time-and-a-half for any hours worked
above 40 hours in a given week. Write a program to input the number
of hours worked and hourly rate and calculate the total wages for the
week.
Output:-
Practical - 4.3
Aim-The Body Mass Index (BMI) is calculated as a person's weight
(in kg), divided by the square of the person's height (in meters). If the
BMI is between 19 and 25, the person is healthy. If the BMI is below
19, then the person is underweight. If the BMI is above 25, then the
person is overweight. Write a program to get a person's weight (in
kgs) and height (in cms) and display a message whether the person is
healthy, underweight or overweight. 𝐵𝑀𝐼 = 𝑊𝑒𝑖𝑔ℎ𝑡 𝑖𝑛 𝑘𝑔
(𝐻𝑒𝑖𝑔ℎ𝑡 𝑖𝑛 𝑚) 2
output :-