USN 1 S G
SAPTHAGIRI COLLEGE OF ENGINEERING
Department of Computer Science and Engg.
Internal Assessment Test –II
Subject: Python Application Programming Sub Code: 17CS664
Semester/Section: 6 A & B Max Marks: 30
Duration: 1.0 hours Date: 15/05/2020
Note: Answer any two full questions, choosing one from each module
Ques Questions Marks BLT CO’s
tion
No.
Module 1
1 a. What are the different ways of deleting elements from a list? Discuss with suitable 5 L1, L2 CO3
functions.
b. Consider the list scores = [5, 4, 7, 3, 6, 2, 1] and write the python code to perform the 10 L1, L2 CO3
following operations:
i) Insert an element 9 at the beginning of the list.
ii) Insert an element 8 at the index position 3 of the list.
iii) Insert an element 7 at the end of the list.
iv) Delete all the elements of the list.
v) Delete an element at the beginning of the list.
OR
2 a. How tuples can be used as a key for dictionaries? Discuss with example. 5 L2,L3 CO3
b. Write a program to read and validate the USN (both UG and PG) of VTU students 10 L2, L3 CO3
and display appropriately a message whether student is UG or PG student. (Hint:
UG USN format: 1SG17CS001, PG USN format: 1SG15SCS01)
Module 4
3 a. Define class and object. Given an example for creating a class and an object of that 5 L1, L2 CO4
class.
b. Write a program to create a class called Rectangle with the help of a corner point, width 10 L1, L2 CO4
and height. Write
following functions and demonstrate their working:
a. To find and display center of rectangle
b. To display point as an ordered pair
c. To resize the rectangle
OR
4 a. Differentiate pure functions and modifiers with suitable examples 5 L2, L3 CO4
b. Write a program to create a class Time to represent time in HH:MM:SS format. 10 L1, L2 CO4
Perform following operations:
a. Overload + to add two time objects
b. Overload + to add a numeric value to a time object
(commutative)
c. Overload __str__() to display time in appropriate format
CO3- Create, run and manipulate Python Programs using core data structures like Lists, Dictionaries and use
Regular Expressions.
CO2 – Interpret the concepts of Object-Oriented Programming as used in Python.