Python Handout
Python Handout
COURSE HANDOUT
L T
Course Objective:
The objective of this course is to enable students to understand the fundamentals of Python
programming. The course aims to develop programming skills using Python data types, operators,
control statements, sequence data types, functions, modules, NumPy, file handling and exception
handling. It also enables students to write, execute and debug Python programs for solving basic
computational and real-world problems.
Course Outcomes (COs): After completion of the course, the students will be able to-
CO : Use various data types and operators in formation of expressions.
1
PSO1 Apply programming, database and software development skills to solve computing
problems.
PSO2 Use modern tools and technologies for developing computer-based applications.
PSO3 Demonstrate professional skills for industry, entrepreneurship and higher studies.
PART-A THEORY
E-References
• [Link]
• [Link]
• [Link]
Lesson Plan:
Tentative Actual
Teaching
Lectur Topic to be Relevant Relevant Date of Date of
Learning Remarks
e No. covered TSO(s) CO(s) Completio Completio
Methods
n n
Differentiate
between
Procedure
Introduction
Oriented
to Python,
Programming
character Lecture,
1 and Object CO1
set, tokens Discussion
Oriented
and
Programming
variables
approach
with
example.
Operators,
expressions, Write Python
statements, program
Lecture,
type using various
4 CO1 Problem
conversion, data types
Solving
input/output and
and operators.
precedence
Tentative Actual
Teaching
Lectur Topic to be Relevant Relevant Date of Date of
Learning Remarks
e No. covered TSO(s) CO(s) Completio Completio
Methods
n n
Write
Python
Conditional
program
statements: Lecture,
5 using CO2
simple if Examples
decision
statement
making
statements.
Write
Python
program Lecture,
if-else
6 using CO2 Problem
statement
decision Solving
making
statements.
Write
Python
program
if-elif-else Lecture,
7 using CO2
statement Demonstration
decision
making
statements.
Write
Python
while loop
program
and
using loop Lecture,
8 iterative CO2
structure to Examples
problem
solve
solving
iterative
problems.
Write
Python
program
for loop and Lecture,
using loop
9 range CO2 Practical
structure to
function Example
solve
iterative
problems.
Write
Python
break, program
Lecture,
continue using loop
10 CO2 Problem
and nested structure to
Solving
loops solve
iterative
problems.
Perform various
Introduction
operations on List Lecture,
13 to list and CO3
using list operators Examples
indexing in list
and methods.
List
operations: Perform various
Lecture,
concatenation, operations on List
14 CO3 Problem
repetition, using list operators
Solving
membership and methods.
and slicing
Tuple
assignment, Perform various
tuple operations on
Lecture,
18 operations, tuples using tuples CO3
Demonstration
tuple methods operators and
and nested methods.
tuples
Set
operations: Perform various Lecture,
20 union, operations on set CO3 Problem
intersection using set methods. Solving
and difference
Dictionary
mutability, Perform various
Lecture,
adding, operations on
22 CO3 Practical
modifying and dictionary using
Example
built-in dictionary methods.
functions
Create and
use user
Functions: built-in
defined
functions, module
functions to Lecture,
23 functions and CO4
implement Examples
user-defined
modular
functions
programming
approach.
Create and
use user
Creating user- defined
defined functions, functions to Lecture,
24 CO4
arguments and implement Demonstration
parameters modular
programming
approach.
Create and
use user
Default
defined
parameters, Lecture,
functions to
25 positional CO4 Practical
implement
parameters and Example
modular
lambda functions
programming
approach.
Import and
PyPI and pip Lecture,
use Python
29 Python package CO4 Practical
modules,
manager Demonstration
libraries.
UNIT-5: NumPy
Tentative Actual Date Teaching
Lecture Topic to be Relevant Relevant
Date of of Learning Remarks
No. covered TSO(s) CO(s)
Completion Completion Methods
Creation of
Use NumPy
arrays using Lecture,
array in
32 [Link](), CO5 Practical
Python
[Link](), Example
program.
[Link]()
Array
Use NumPy
attributes:
array in Lecture,
33 shape, size CO5
Python Demonstration
and
program.
dimensions
Use NumPy
Lecture,
Array indexing array in
34 CO5 Problem
and slicing Python
Solving
program.
One-
Use NumPy
dimensional Lecture,
array in
35 and multi- CO5 Practical
Python
dimensional Example
program.
array indexing
Array
Write simple
operations
Python Lecture,
36 and element- CO5
programs Examples
wise
using numpy.
operations
Use NumPy to
Lecture,
Linear algebra solve linear
38 CO5 Problem
with NumPy algebra
Solving
problem.
Use NumPy to
Solving linear Lecture,
solve linear
40 equations CO5 Practical
algebra
using NumPy Example
problem.
File
Write simple
input/output
Python Lecture,
41 and CO5
programs Demonstration
broadcasting
using numpy.
in NumPy
Explain
Syntax errors,
different
exceptions and Lecture,
42 types of CO6
need of exception Examples
Exceptions in
handling
Python.
Write Python
User-defined programs for
Lecture,
43 exceptions and exception CO6
Demonstration
raising exceptions handling in
Python.
Write Python
try-except-else programs for Lecture,
44 and try-finally exception CO6 Practical
clause handling in Example
Python.
Explain
different
Built-in exception Lecture,
45 types of CO6
classes Examples
Exceptions in
Python.
Perform
Opening, closing, read, write,
Lecture,
47 reading and append CO6
Demonstration
writing files operations in
files.
Perform
Reading/writing read, write, Lecture,
48 binary files and append CO6 Practical
file access modes operations in Example
files.
Actual
Tentative Teaching
Lectur Topic to be Relevant Relevant Date of
Date of Learning Remarks
e No. covered TSO(s) CO(s) Completio
Completion Methods
n
Create and
use user
Introduction defined
to Python functions to ICT,
1 CO4
GUI using implement Demonstration
Tkinter modular
programming
approach.
Introduction
Write simple
to Data
Python
2 Visualization CO5 Demonstration
programs
using
using numpy.
Matplotlib
Write and
execute
Introduction
programs
to Python CO2, Practical
3 using control
mini-project CO3 Demonstration
statements
development
and sequence
data types.
CO If 60% of the students scoring more than or equal to 60% of marks in COx. 3
ATTAINMENT If 50% of the students scoring more than or equal to 60% of marks in COx. 2
TARGET LEVEL
(RUBRICS) If 40% of the students scoring more than or equal to 60% of marks in COx. 1
PART-B LABORATORY (PRATICAL)
Define NumPy array and perform Write programs to create NumPy arrays, CO2, CO5
NumPy operations. check rows, remove non-numeric rows,
count sequence occurrences, find frequent
value, combine arrays, flatten matrix and
interchange axes.
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Course faculty shall plan and conduct the laboratory sessions as per the practical list prescribed in the
curriculum of Python Programming. The practical sessions shall cover all Course Outcomes (COs)
through hands-on activities related to Python syntax, data types, operators, control statements, strings,
lists, tuples, sets, dictionaries, functions, modules, NumPy, exception handling and file handling. The
faculty shall ensure that adequate sessions are allotted for each practical and that students perform the
practical work using Python IDLE or any suitable Python programming environment.
Actual
Lab Tentative Teaching
Title of Practical Relevant Relevan Date(s) of
Session Date(s) of Learning Remarks
to be covered LSO(s) t CO(s) Completio
No. Completion Methods
n
Write and
execute
simple
Python
Calculate area of
program Practical
2 triangle using CO-1 10/07/26
using Demonstration
given sides.
variables
and
arithmetic
expressions.
Write and
execute
simple
Swap two
Python
variables and Practical,
program
3 solve quadratic CO-1 11/07/26 Problem
using
equation for real Solving
variables
numbers.
and
arithmetic
expressions.
Write and
execute
Check whether a
Python
number is Practical
4 programs CO-2 17/07/26
positive, negative Demonstration
using
or zero.
conditional
statements.
Write and
execute
Check whether Python Practical,
5 the given year is a programs CO-2 18/07/26 Problem
leap year. using Solving
conditional
statements.
Perform
various
Check whether a
operations
string is
on string CO-2, Practical
8 palindrome and 31/07/26
using string CO-3 Demonstration
reverse words in a
operators
string.
and
methods.
Perform
various
Identify name, operations Practical,
position and on string CO-2, Algorithm
9 07/08/26
counting of using string CO-3 Implementatio
vowels in strings. operators n
and
methods.
Perform
Count matching various
characters in pair operations
of strings and on string CO-2, Practical
10 08/08/26
remove i-th using string CO-3 Demonstration
character from a operators
string. and
methods.
Perform
various
Find largest operations
Practical,
number in list on list using CO-2,
11 14/08/26 Problem
without using list CO-3
Solving
max(). operators
and
methods.
Perform
various
operations
Find common
on list using CO-2, Practical
12 numbers from two 21/08/26
list CO-3 Demonstration
lists.
operators
and
methods.
Perform
various
Create even and
operations
odd lists from a Practical,
on list using CO-2,
13 given list and 22/08/26 Problem
list CO-3
count occurrences Solving
operators
of a number.
and
methods.
Perform
various
operations
Find index and on tuple CO-2, Practical
14 29/08/26
length of a tuple. using tuple CO-3 Demonstration
operators
and
methods.
Perform
various
Reverse a tuple operations
Practical,
and sort list of on tuple CO-2,
15 11/09/26 Problem
tuple by float using tuple CO-3
Solving
element. operators
and
methods.
Perform
Create various
intersection, union operations CO-2, Practical
16 18/09/26
and difference of on sets CO-3 Demonstration
sets. using set
methods.
Perform
various
operations
Concatenate and
on CO-2, Practical
18 merge two 25/09/26
dictionary CO-3 Demonstration
dictionaries.
using
dictionary
methods.
Perform
various
Combine two operations
Practical,
dictionaries by on CO-2,
19 26/09/26 Problem
adding values for dictionary CO-3
Solving
common keys. using
dictionary
methods.
Write a function
Create user-
for reversing a
defined
string and CO-2, Practical
20 functions 03/10/26
calculating CO-4 Demonstration
and call
compound
them.
interest.
Create user-
Write a function Practical,
defined
for calculating CO-2, Algorithm
21 functions 09/10/26
factorial CO-4 Implementatio
and call
expression. n
them.
Develop
and execute
Find most
Python
frequent value,
program
combine arrays, CO-2, Practical
24 using 24/10/26
flatten matrix and CO-5 Demonstration
various
interchange axes
types of
using NumPy.
NumPy
operations.
Develop
Handle
and execute
TypeError,
Python
NameError, Practical,
program to
25 IndexError and CO-6 30/10/26 Problem
handle
KeyError using Solving
various
exception
types of
handling.
exceptions.
Develop
Handle and execute
ValueError, Python
IOError and program to Practical
26 CO-6 31/10/26
ZeroDivisionError handle Demonstration
using exception various
handling. types of
exceptions.
Develop
and execute
Demonstrate file
Python Practical
27 operations: read, CO-6 20/11/26
program to Demonstration
write and append.
perform file
operations.
Full Marks 8 8 4 30 50
2. Accuracy 10% 2
4. Safety Practices 5% 1
5. Teamwork 5% 1
b. Micro Projects: Micro Projects shall comprise small application-based tasks or projects related
to the course outcomes, aimed at providing an opportunity to apply theoretical knowledge in
practical context.
1. Create a shop billing system.
2. Create an income tax calculation system.
3. Develop a number guessing game.
4. Develop a word-to-number converter by assigning numbers to alphabets a-z as 1-26.
5. Design a basic calculator program for addition, subtraction, multiplication and
division.
6. Create a student marks management system using list and dictionary.
7. Create a simple contact book using dictionary and file handling.
8. Create a text file analyzer to count words, lines and characters.
9. Create a simple NumPy-based matrix calculator.
10. Create a mini quiz application using control statements and functions..
c. Self Learning/ LMS Activities: Self-learning activities shall include LMS modules, online
certification courses to promote self learning and enhance technical knowledge and skills.
Suggested Seminar Topics
1. Tkinter widgets in Python
2. Python date/time module and its applications
3. wxPython and its applications
Suggested Self-Learning Topics
1. Python standard library
2. NumPy basics and applications
3. Python package management using pip
4. Python file handling
5. Exception handling in Python
6. Introduction to Python GUI programming
7. Python for data analysis
8. Python modules and packages
9. Regular expressions in Python
10. Object-oriented programming concepts in Python
Component Term work & Self Learning Assessment (TWA), Internal External Total
(20 Marks) Assessment Marks
Full Marks 8 8 4 30 50
Progressive Assignments:At least one assignment shall be assigned after the All COs 8
completion of each unit, ensuring coverage of all COs mapped to
the course. The evaluation shall be carried out based on the
approved rubrics.
Micro Projects: Micro projects aligned with the COs mapped to All COs 8
the course shall be assigned. Depending on the nature of the
micro project, it may be undertaken either individually or in
groups. The evaluation shall be conducted based on the approved
rubrics.
Assessment
Self Learning/ LMS Activities: If the course/module is - 4
available on the LMS, students shall complete the course and
submit the course completion certificate to obtain full marks (4
marks).
In the absence of LMS-based courses, equivalent online learning
certifications/resources such as NPTEL, MOOCs, CISCO,
Spoken Tutorial, NASSCOM, or any other recognized online
certification course may be considered eligible for the same
weightage.
At the end Final Term Work & Self Learning Assessment Marks: A All COs 20
of course
(Average Marks of all Assignment + Average Marks of Micro
Projects + Marks of Self Learning/ LMS Activities)
CO If 60% of the students scoring more than or equal to 60% of marks in COx. 3
ATTAINMENT If 50% of the students scoring more than or equal to 60% of marks in COx. 2
TARGET LEVEL
(RUBRICS) If 40% of the students scoring more than or equal to 60% of marks in COx. 1