Python Programming
Python Programming
B) Course Code:
D) Rationale:
Python is a high-level general-purpose programming language. Python programming is useful across wide
range of application segments from scientific to machine Learning to mobile app development, and so on.
The software library Pandas, written for the Python programming language is useful for data manipulation
and analysis, thus making it suitable for solving problems related to various engineering discipline. This
course enables learners to apply Python programming features which can be used as building blocks to
develop different kind of applications using Python 3. This course also provides the students the
foundations for data analytics with Python.
E) Course Outcomes (COs): After the completion of the course, teachers are expected to ensure the
accomplishment of following industry expected course outcomes by the learners.
S. Course
No. Outcomes Course Outcome Statements
(COs)
1. CO-1 Write and execute programs using control statements
2. CO-2 Perform relevant operations on Sequence data types
3. CO-3 Create functions in modules
4. CO-4 Use object-oriented features in writing python programs
5. CO-5 Handle data files and exceptions.
6. CO-6 Analyse given data by using Pandas package of Python
CO-1 1 - 1 - 1 - - - - - - -
CO-2 1 1 1 - 1 - - - - - - -
CO-3 1 - 1 - 1 - - - - - - -
CO-4 1 - 1 - 1 - - - - - -
CO-5 1 1 1 - 1 - - - - - - 1
CO-6 1 2 2 1 1 - - 1 - - - 1
Legend: High (3), Medium (2), Low (1) and No mapping (-)
(TA) Assessment
(TW+ SL)
Study CourseTitles
(PTWA)
(PTA)
(ETA)
(PLA)
(ELA)
ESC Python programming 02 - 02 02 06 3 - - 25 25 25 25 100
Legend:
CI: Classroom Instruction (Includes different instructional/implementation strategies i.e. Lecture (L), Tutorial (T), Case
method, Demonstrations, Video demonstration, Problem based learning etc. to deliver theoretical concepts)
LI: Laboratory Instruction (Includes experiments/practical performances /problem-based experiences in laboratory,
workshop, field or other locations using different instructional/Implementation strategies)
TW: Term work (includes assignments, seminars, micro projects, industrial visits, any other student activities etc.)
SL: Self Learning, MOOCs, spoken tutorials, online educational resources etc.
PTA: Progressive Theory Assessment in class room (includes class test, mid-term test and quiz using online/offline modes)
PLA: Progressive Laboratory Assessment (includes process and product assessment using rating Scales and rubrics)
TWA: Term work & Self Learning Assessment (Includes assessment related to student performance in assignments, seminars,
micro projects, industrial visits, self-learning, any other student activities etc.
Course Category: Basic Science Courses (BSC), Engineering Science Courses (ESC), Professional core courses (PCC),
Professional Core Elective (PCE), Professional Open Electives (POE), Humanities and Social Science Courses (HSC),
Project, Seminar, Internship (PSI), Mandatory Courses (MNC)
H) Course Curriculum Detailing: For attainment of course outcomes, the students are expected to
perform/ undergo various activities through classroom, laboratories/ workshops term/ work, self-
learning/ field sessions. As per the requirements of NEP: 2020, unique features like Green skills,
Multidisciplinary Aspects, Societal Connect, IKS, Renewable Energy are integrated appropriately.
TSO 3a. Create and use user defined functions to Unit-3.0 Python Functions, Modules and CO3
implement modular programming approach Packages
TSO 3b. Differentiate variable scope with example. 3.1 Functions: types of function (built- in
TSO 3c. Import and use Python modules, libraries functions, functions defined in module,
user defined functions), creating user
defined function, arguments and
parameters, default parameters, positional
parameters, Lambda functions, returning
value, scope of a variable: global scope,
local scope
TSO 6b. Write Programs using Pandas to perform 6.1 Pandas data structures: Series,
various operations andfunctions on series. Declaration, selecting elements, assigning
values, Filtering values, operations,
TSO 6c. Perform various operation in a DataFrame mathematical functions, evaluating values,
columns and rows handling missing data, creating series from
dictionaries, adding two series.
TSO 6d. Write Programme to read and writeon CSV, 6.2 Data Frame: Defining, selecting elements,
XLS and Text data files assigning values, membership, deleting a
column, filtering. Index Objects: Indexing,
TSO 6e. Apply various data cleaning operations and Re-indexing, Dropping, sorting and
prepare data. ranking,Descriptive Statistics
6.3 Data Loading: Reading and Writing csv,
xls, text data files, Data Cleaning and
Preparation: Handling missing data,
removing duplicates, replacing values,
Vectorized String Methods, Hierarchical
Indexing, Merging and Combining, Data
aggregation and Grouping.
J) Suggested Laboratory (Practical) Session Outcomes (LSOs) and List of Practical with
Assessment Table:
PLA/ELA (%)
Relevant Performance Viva
Practical/Lab Session Outcomes S. Laboratory Experiment/Practical COs
(LSOs) No. Titles Number Process Product
-
(s) Assess- Assess Voce
ment -ment
LSO 1.1. Write, execute and 1. a) Download and Install IDLE. CO-1 40 50 10
debug simple Python
program using Write and execute Python program to-
Integrated Development
and Learning b) Calculate the Area of a Triangle
Environment (IDLE) where its three sides a, b, c are
LSO 1.2. Write and execute given. s=(a+b+c)/2, Area=square
simple ‘C’ program root of s(s-a)(s-b)(s-c) (write
using variables, program without using function)
arithmetic expressions. c) Swap Two Variables
d) Solve quadratic equation for real
numbers.
LSO 2.1. Write and execute 2. Write and execute Python program to- CO-1 40 50 10
python programs using
conditional statements. a) Check if a Number is Positive,
Negative or zero.
LSO 2.2. Write and execute
b) Check whether the given year is a
python programs using
Leap Year.
various types of Loop
c) Print all Prime Numbers in an
statements
Interval.
d) Display the multiplication Table
based on the given input.
e) Print the Fibonacci sequence.
f) Find the Factorial of a Number.
LSO 3.1. Write and execute 3. Write and execute Python program to- CO-1, 40 50 10
Python program to CO-2
perform various a) Check whether the string is
operations on string Palindrome
using string operators b) Reverse words in a given String in
and methods Python
c) identify in a strings the name,
position and counting of vowels.
d) Count the Number of matching
characters in a pair of string (set)
e) Python program for removing i-th
character from a string
LSO 4.1. Write and execute 4. Write and execute Python program to- CO-1, 40 50 10
Python program to CO-2
perform various a) find largest number in a given list
operations on List using without using max().
List operators and b) find the common numbers from
methods two lists.
c) create a list of even numbers and
another list of odd numbers from a
given list.
d) To find number of occurrences of
given number without using built-
in methods.
PLA/ELA (%)
Relevant Performance Viva
Practical/Lab Session Outcomes S. Laboratory Experiment/Practical COs
-
(LSOs) No. Titles Number Process Product
(s) Assess- Assess Voce
ment -ment
LSO 5.1. Write and execute 5. Write and execute Python program to- CO-1, 40 50 10
Python program to CO-2
perform various
operations on Tuple a) find the index of an item of a
using Tuple operators tuple.
and methods. b) find the length of a tuple.
c) to reverse a tuple.
d) Write a Python program to sort a
list of tuple by its float element.
Sample data: [('item1', '12.20'),
('item2', '15.10'), ('item3', '24.5')]
Expected Output: [('item3', '24.5'),
('item2', '15.10'), ('item1', '12.20')]
LSO 6.1. Write and execute 6. Write and execute Python program to- CO-1, 40 50 10
Python program to CO-2
perform various a) create an intersection of sets.
operations on sets using b) create a union of sets.
set methods. c) create set difference.
d) check if two given sets have no
elements in common.
LSO 7.1. Write and execute 7. Write and execute Python program to- CO-1, 40 50 10
Python program to CO-2
perform various a) Write a Python script to concatenate
operations on Dictionary two dictionaries to create a new one
using Dictionary b) Write a Python script to merge two
methods Python dictionaries.
c) Write a Python program to combine
two dictionary adding values for
common keys.
d1 = {'a': 100, 'b': 200, 'c':300}
d2 = {'a': 300, 'b': 200, 'd':400}
Sample output: d({'a': 400, 'b': 400,
'd': 400, 'c': 300})
LSO 8.1. Write and execute 8. Write and execute Python program to- CO-1, 40 50 10
Python program to CO-3
create user defined
functions and call them. a) Write a Python function for
reversing a string and call it.
b) Write a Python function for
calculating compound interest and
call it.
c) Write a Python function for
calculating the factorial of a number
and call it to calculate !n/(!r)*!(n-r))
where symbol “! “ stands for
factorial.
LSO 9.1. Write and execute 9. Write program using OOP approach to – CO-1, 50 40 10
Object Oriented Python a) create an instance of a specified CO-4
program to define a class and display the namespace of
class and its instances. the said instance
LSO 9.2. Develop and execute b) create a Python class named Student
Python program Using with two attributes: student_id,
various types of student_name. Add a new attribute:
inheritances. student_class. Create a function to
PLA/ELA (%)
Relevant Performance Viva
Practical/Lab Session Outcomes S. Laboratory Experiment/Practical COs
-
(LSOs) No. Titles Number Process Product
(s) Assess- Assess Voce
ment -ment
LSO 9.3. Develop and execute display all attributes and their
Python program Using values in the Student class.
various types of c) Create a Python class named
inheritances. Student with two instances
LSO 9.4. Develop and execute student1, student2 and assign values
Python program Using to the instances' attributes. Print all
various types of the attributes of the student1,
Polymorphism. student2 instances
d) Write programs to demonstrate use
of following types of inheritance:
i. Single inheritance
ii. Multiple inheritance
iii. Multilevel inheritance
e) Demonstrate use of polymorphism
with following situations:
i. Polymorphism in operator
ii. Polymorphism in user defined
method
iii. Polymorphism in built-in
function
iv. Polymorphism with class
method
v. Polymorphism with method
overriding
LSO 10.1. Develop and execute 10. a) Using exception handling feature CO-5, 60 30 10
Python program to such as try…except, try finally- CO-1
handle various type of write minimum three programs to
exceptions. handle following types of
LSO 10.2. Develop and execute exceptions.
Python program to i. TypeError
perform file operations. ii. NameError
iii. IndexError
iv. KeyError
v. ValueError
vi. IOError
vii. ZeroDivisionError
LSO 11.1. Create series using list 11 Working with a Series using Pandas CO-6 50 40 10
anddictionary in pandas a) Create a series using list and
LSO 11.2. Print different values dictionary. 10b. Create a series
from series in pandas. using NumPy functions
inPandas.
b) Print the index and values of
series.
c) Print the first and last few rows
from theseries.
LSO 12.1. Perform various 12 Working with Data Frame Rows CO-6 50 40 10
operation in aData a) Slicing Data Frame
Frame rows using loc and iloc.11b.
Filter multiple rows
using isin.
b) Select first n rows and last n rows
c) Select rows randomly n rows
PLA/ELA (%)
Relevant Performance Viva
Practical/Lab Session Outcomes S. Laboratory Experiment/Practical COs
-
(LSOs) No. Titles Number Process Product
(s) Assess- Assess Voce
ment -ment
and fractionsof rows (use df.
sample method)
d) Count the number of rows
with eachunique value of
variables
e) Select nlargest and nsmallest
values.11g. Order/sort the rows
LSO 13.1. Apply different 8 Merge and combine data CO-6 50 40 10
techniques to merge and a) Perform the append, concat
combine data and combinefirst operations
on Data Frames.
b) Apply different types of merge
on data. 12c. Use a query
method to filter Data Frame
c) with multiple conditions.
Note: This table can be used for both end semester laboratory assessment (ELA) as well as progressive assessment of practical
(PLA). Rubrics need to be prepared by the course wise teacher for each experiment/practical to assess the student performance.
Seminar Topics:
b. Micro Projects:
Expected Outcomes (a. Identify missing data, b. Find Duplicates values, c. Write
the dataframe to aCSV file in the local directory.)
3. Working with Data Frame Columns
c. Others:
Data Source:
▪ https://archive.ics.uci.edu/ml/machine-learning-databases/auto-mpg/
▪ https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data
▪ https://www.kaggle.com/arshid/iris-flower-dataset
▪ https://www.kaggle.com/rohankayan/years-of-experience-and-salary-dataset
Note: Similar table can also be used to design class/mid-term/ internal question paper for progressive assessment.
a) Books
• https://docs.python.org/3/tutorial/
• https://nptel.ac.in/courses/106106145
• https://www.w3schools.com/python/
• https://www.tutorialspoint.com/python/index.htm
• https://www.w3schools.com/python/pandas/default.asp
• https://pandas.pydata.org/docs/user_guide/10min.html
• http://bedford-computing.co.uk/learning/wp-content/uploads/2015/10/Python-
Cookbook-3rd-Edition.pdf
*******