Professional Documents
Culture Documents
Introduction to python
Lab-Sheet-05
Reg. No Ck-20-110024
Program BSCS
Instructor
Mujtaba Awan
mujtaba@iqrauni.edu.pk
Week 4
Lab-sheet 4
Introduction to pythonLab 4
Lab Objectives:
Tasks
1) Write a program to check whether a person is eligible for voting or not. (accept age from
user)
Program coding:
Program coding:
Program coding:
Program coding:
Program coding:
6) Write a program to accept percentage from the user and display the grade according to
the following criteria: using IF else statement.
Marks Grade
> 90 A
> 80 and <= 90 B
>= 60 and <= 80 C
below 60 D
Program coding:
Output:
7) Write a program to find the lowest number out of two numbers excepted from user.
Program coding:
Output:
Program coding:
Program coding:
Program coding:
if per1 < per4 and per1 < per2 and per1 < per3:
print("\nYoungest is person 1 age is: ",
per1, " Year's")
elif per2 < per1 and per2 < per3 and per2 < per4:
print("\nYoungest is person 2 age is: ",
per2, " Year's")
elif per3 < per4 and per3 < per2 and per3 and
per1:
print("\nYoungest is person 3 age is: ",
per3, " Year's")
elif per4 < per3 and per4 < per2 and per4 < per1:
print("\nYoungest is person 4 age is: ",
per4, " Year's")
Output:
…The End…