D 0800ITT205122101 Pages: 2
Reg No.:_______________ Name:__________________________
APJ ABDUL KALAM TECHNOLOGICAL UNIVERSITY
Third Semester B.Tech Degree Regular and Supplementary Examination December 2022 (2019 Scheme)
Course Code: ITT205
Course Name: PROBLEM SOLVING USING PYTHON
Max. Marks: 100 Duration: 3 Hours
PART A
Answer all questions. Each question carries 3 marks Marks
1 What is ‘pass’ statement in python? Explain with example. (3)
2 Write a python program to check whether a number is positive or negative. (3)
3 How do you display last character in a string using slicing operator? (3)
4 What is the purpose of the following data types in python (i) list (ii) tuple (3)
(iii)dictionary
5 How do we create packages in Python? What are the advantages of packages in (3)
python?
6 What is a lambda function? Give an example. (3)
7 What are the different file operations is python? How do we display contents of (3)
the file in python?
8 Write a python program to handle division by zero exception. (3)
9 How do we initialize objects in python? (3)
10 Write a class for Vehicle (model, color, manufacturer). Also define a constructor (3)
and destructor for the class.
PART B
Answer any one full question from each module. Each question carries 14 marks
Module 1
11 (a) Explain different decision making statements in python with examples? (12)
(b) What is the purpose of indentation in python? Explain with an example. (2)
12 (a) Write a python program to display Fibonacci series up to ‘n’. (10)
(b) Differentiate continue and break statements with examples.
(4)
Module 2
13 (a) Write a Python program to delete all the vowels from a string. (7)
(b) Explain on how to iterate through the tuple elements. (7)
Page 1of 2
0800ITT205122101
14 (a) How do you access dictionary elements. Explain with an example. (7)
(b) Write a python program to add two matrices.
(7)
Module 3
15 (a)What is the advantage of using recursion? Write a python program to reverse (7)
a string using recursion.
(b)Write a python program to find x2 +y2 using functions. (7)
16 (a) Create a module ‘calculator’ with following functionality: (i) Addition (ii) (6)
Subtraction (iii) Multiplication (iv) Division.
(b) Explain any four built in functions in python with an example. (8)
Module 4
17 (a)Write a python program to count the total number of characters in the file. (7)
(b) Write a python program to copy the contents of one file to another file.
(7)
18 (a) Explain how exceptions can be handled in python with an example. (7)
(b) Write a python program for implementing a calculator, and handle all types of
(7)
exceptions. All numbers should be read from the user.
Module 5
19 (a) Create a class Employee with attributes name, age and salary. Also, create two (9)
objects e1 and e2. Display name of the employee having the highest salary.
(b) Differentiate constructors and destructors in python with examples. (5)
20 (a) Explain different types of inheritance with example. How is multiple (10)
inheritance implemented in python.
(b) Explain how objects can be passed to functions. (4)
Page 2of 2