0% found this document useful (0 votes)
28 views

AI Lab 01 Lab Tasks

The document outlines a lab session on fundamental Python concepts including print statements, variables, data types, exceptions, conditional statements, and nested conditions. It provides 9 tasks for students to complete short Python programs related to personal profiles, calendars, grocery costs, grades calculation, division with exceptions, delivery charges, university admissions, and weather forecasting.

Uploaded by

Maaz
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

AI Lab 01 Lab Tasks

The document outlines a lab session on fundamental Python concepts including print statements, variables, data types, exceptions, conditional statements, and nested conditions. It provides 9 tasks for students to complete short Python programs related to personal profiles, calendars, grocery costs, grades calculation, division with exceptions, delivery charges, university admissions, and weather forecasting.

Uploaded by

Maaz
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Lab Session -01

Artificial Intelligence (Comp – 00634)


Lab Session-01

Objective: Understanding the fundamental concepts of Python.

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

Write/copy your code here:

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

7- Create a python program to check a student’s eligibility for admission to a university.


Your program should use multiple conditions, logical operators and nested conditions
to determine if the student meets the admission criteria based on ECAT scores, FSc.
Marks and advanced course work completion.
Write/copy your code here:

8- Create a python program to simulate a weather forecasting system. Your program


should use conditional statements, Boolean variables, and nested conditions to
predict the weather for the day based on user input weather conditions such as
temperature, humidity and wind speed.

Write/copy your code here:

9- Write a conclusion of this lab in your own words.

Write your answer here by hand:

4
Lab Session-01

You might also like