PYTHON PROGRAMMING Aug-2022 Paper
1. a. Why is Python called as an object oriented language? Explain some of the object oriented
features of Python. (4M)
b. Explain about different data types available in Python. Give Examples (10M)
2. a. How many types of functions are available in Python? List a few built in functions along with
examples. (4M)
b. Demonstrate a function definition in Python? Explain the concept of default (10M)
3. a. How are strings declared in Python? Why strings are immutable while list is mutable. (7M)
b Explain different ways of traversing a list. Design code for adding elements in a list. (7M)
4. a. Justify the purpose of Exception Handling? Explain the exception hierarchy in Python(7M)
b. Explain about regular expressions in Python. (7M)
5. a. Propose Python code for opening a text file, reading the contents and printing it on the screen.
(7M)
b. Propose a Python code for connecting to a MySQL database and perform some DDL and DML
operations (7M) (out of syllabus)
6. a. Compare and Contrast Structured Programming and Object Oriented Programming with
suitable example (7M)
b. Distinguish Dictionary and Set. Design code for declaring a dictionary and a set, display
contents in both. (7M)
7. a. How are classes and objects declared in Python? Explain using a sample code (7M)
b. What are the different access modifiers used in a class? Explain the purpose of self keyword.
(7M)
8. a. Define Polymorphism. How is polymorphism achieved in Python? (7M)
b.Write a program to handle the default exceptions in Python. (7M)