17cs664 QP - 2 - IA2020
17cs664 QP - 2 - IA2020
17cs664 QP - 2 - IA2020
Note: Answer any two full questions, choosing one from each module
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:
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
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:
(commutative)
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.