AI Lab 01 Lab Tasks
AI Lab 01 Lab Tasks
A- Outcomes:
After completion of the lab session students will be able:
a. To review print statement, format strings & comments.
b. To learn about variables & data types,
c. To handle exceptions.
d. To understand conditional statements (if, elif, else)
e. To understand nested conditions & conditional programming with Boolean
variables.
1
Lab Session -01
B- Lab Tasks:
1- Create a python program that prints your personal profile. Your profile should
include:
Your full name
Your age
Your address
Your email address
A short description of yourself.
You should use the “print” command, string formatting and comments to
make your program easy to read & understand.
Write/copy your code here:
2- Imagine you are building a calendar application. Write a python program that prints
the details of a simple calendar event including:
Event title
Date & Time
Location
Description
Use the string formatting to make the output clear & readable.
Write/copy your code here:
3- Create a Python program to calculate the total cost of groceries. Your program
should:
Define the prices of various grocery items
Calculate the total cost of groceries purchased
Display the item names, quantities, prices & the total cost.
2
Lab Session -01
4- Imagine you are a teacher and you need to calculate student’s final grades based
on their scores for assignments, quizzes and exams. Create a python program that:
Prompts the user to enter their scores for assignments, quizzes and
exams.
Calculates the final grade using a predefined grading formula.
Displays the final grade and a pass/fail status without using “if” and
“else”
Write/copy your code here:
5- Create a python program for a division calculator. Your program should use
exception handling to address potential errors.
Write/copy your code here:
6- Create a python program to calculate the delivery charge for an online shopping
order. Your program should use conditional statements to apply different delivery
charges based on the order amount and delivery distance.
Write/copy your code here:
3
Lab Session -01
4
Lab Session-01