Advanced Python Programming
Subject code – CSE301
1. RATIONALE
In previous semester (Semester II) students have learned basics of python programming. They
understand developing programs to solve simple problems using various features of the ‘Python’
language. Python is a modern language useful for writing compact codes specifically for programming
in the area of Server-side Web development, Data Analytics, AI, and scientific computing as well as
production tools and game programming. This course deals with some advanced features of the
‘Python’ language. The programming skills thus acquired can be used for developing programs with
advanced level programming features which in turn will be helping in developing practical
applications for the scientific, research and business purposes. At the end of the course, the student
will be able to develop programs with adequate advanced concepts using python language.
2. COMPETENCY
The purpose of this course is to help the student to attain the following industry identified competency
through various teaching-learning experiences:
● Develop a program using advanced python language concepts to solve the
given problem.
3. COURSE OUTCOMES (COs)
The practical exercises, the underpinning knowledge, and the relevant soft skills associated with this
competency are to be developed in the student to display the following COs:
The student will develop underpinning knowledge, adequate programming skills of competency for
implementing various applications using python programming language to attain the following course
outcomes.
a) Develop python programs by applying data structures - dictionary, tuple, and set
concepts.
b) Develop modules and packages in python programs for modular programming
approach.
c) Implement error handling techniques using exception handling.
d) Develop python programs using file input/output operations.
e) Draw graphics using the turtle module.
4. CONTENT
Unit Outcomes Topics and Sub-topics
Unit – I 1.1 Use of String and 1.1.1 Introduction to Strings, Lists
Basic of list operations in python 1.2.1 Set
python programs. ● Sets in Python
data 1.2 Use built-in functions for Set ● Create a Set, Accessing Python
structure - manipulation. Sets, Delete from sets, Update sets
Dictionary, 1.3 Use of Tuple operations in ● Python Set Operations
Tuple and Set python programs. 1.3.1 Tuple
1.4 Use built-in functions for ● Tuples in Python
Dictionary manipulation. ● Creating Tuples
● Accessing Tuple
○ Iterate over tuples
○ Slicing tuples
● Tuples are Immutable
● Python Tuple Operations
● Built-In Tuple Functions
and methods
1.4.1 Dictionary
● Dictionaries in Python
● Creating Dictionaries
● Accessing Items in
Python Dictionaries
● Add, Update, Remove
in Dictionaries
● Properties of Dictionary Keys
● Built-In Dictionary Methods
and functions
Unit – II 2.1 Describe creating and 2.1.1 Introduction to module
Modules importing module 2.1.2 Creating user defined module
and 2.2 Describe creating and 2.1.3 Importing a module in python
Packages importing package ● Normal import
2.3 PIP - Package Installer for ● From import
Python ● From import with *
2.1.4 Module search path
2.2.1 Introduction to Packages
2.2.2 Creating user defined package
2.2.3 Importing a package in python
● Normal import
● From import
● From import with *
2.2.4 Intra-package References
2.3.1 Installing PIP
2.3.2 Installing/uninstalling python
packages
Unit– III 3.1 Explain errors & exceptions 3.1.1 Introduction to Exception
Exceptio 3.2 List types of Exceptions 3.2.1 Types of Exceptions :
n 3.3 Implement Raising Exceptions ● Built-in Exceptions
handling 3.4 Implement Handling ● User defined Exceptions
Exceptions 3.3.1 Raising Exceptions
3.4.1 Handling Exceptions
● Try clause
● Except clause
● Finally clause
Unit– IV 4.1 List types of file 4.1.1 Introduction to files and its types.
Files 4.2 Explain basics of file creation, ● Binary files
Handling reading and writing in context to ● Text files
file handling. 4.2.1 Opening and Closing Text File
4.3 Explain setting file offsets 4.2.2 Reading and Writing Files
4.4 Explain Object Serialization. 4.3.1 Setting Offsets in File
4.4.1 Object Serialization -
PickleModule
Unit– V 5.1 Explain turtle graphics module 5.1.1 Introduction to turtle graphics
Graphics 5.2 Implement graphics using 5.2.1 Turtle methods
with Turtle turtle 5.2.2 Turtle Screen Methods
5.3 Use loops and conditional 5.3.1 Turtle programming - loops and
statements to draw graphics conditional statements.
Advanced Python Programming Lab
Subject code – CSE301P
PRACTICAL EXERCISES
Approx.
S. Uni
Practical Hrs.
No. t
require
No.
d
1 Write a program to demonstrate the set functions and operations. I 02
Write a program to input n numbers from the user and store these I 02
2 numbers in a tuple. Print the maximum and minimum number from
this tuple.
Create a user-defined function that prints a tuple whose values are I 02
3 the cube of a number between 1 and n (both included), Where n is
an integer number and passed as an argument.
Write a program to input names of n employees and store them in a I 02
4 tuple. Also, input a name from the user and find if this employee is
present in the tuple or not.
5 Write a program to demonstrate tuples functions and operations I 02
Create a dictionary with the roll number, name, and marks of n I 02
6 students in a class and display the names of students who have
scored marks above 75.
7 Write a program to count the number of times a character appears I 02
in a given string using a dictionary.
Write a user-defined function to convert a number entered by the I 02
8 user into its corresponding number in words. For example, if the
input is 789 then the output should be ' Seven Eight Nine ‘.
Write a program to concatenate the following dictionaries to create I 02
a new one.
Sample Dictionary:
9 dic1={1:10, 2:20}
dic2={3:30, 4:40}
dic3={5:50,6:60}
Expected Result: {1: 10, 2: 20, 3: 30, 4: 40, 5: 50, 6: 60}
Write a program to demonstrate the dictionaries functions and I 02
10
operations.
Write a program to define a module to find the area and II 02
circumference of a circle.
11 a) Import the module to another program.
b) Import a specific function from a module to another program.
Create a package named Demo Package which contains two II 02
modules named mathematics and greets. The mathematics
module contains sum, average, power functions, and the greets
12 module contains the say Hello function.
a) import the module from a package to another program.
b) import a specific function from a module.
Install urllib3 package using PIP. Send HTTP requests to any II 02
13 URLand print status for the same.
Write a program to catch on Divide by zero Exception with II 02
14 I
finallyclause.
Write a user-defined exception that could be raised when the text II 02
15 I
entered by a user consists of less than 10 characters.
16 Write a python program to demonstrate exception handling. II 02
I
17 Write a program to read the content of file line by line and write it I 02
V
to another file except for the lines containing "a" letter in it.
Write a program that inputs a text file. The program should print I 02
18 V
all of the unique words in the file in alphabetical order.
Write a program to create a binary file to store Rollno and Name, I 04
19 Search any Rollno and display name if Rollno found otherwise V
“Rollno not found”.
20 Write a program to demonstrate the file and file I/O operations. I 02
V
21 Draw square, rectangle, and circle using Turtle. V 02
22 Draw color-filled shapes (square, rectangle, and circle) using Turtle. V 02
23 Draw a smiling face emoji and rainbow using Turtle. V 04
24 Draw an Indian Flag and an Olympic Symbol using Turtle V 04
25 Draw a chessboard using Turtle. V 02
Total 56