You are on page 1of 3

Total No. of Questions : 8] SEAT No.

8
23
P-9073 [Total No. Of Pages : 3

ic-
tat
[6178] - 8

4s
F.E.

5:3
02 91
Programming and Problem Solving

3:3
0
41
(2019 Pattern) (Semester - I) (110005)
0/0 13
Time :2½ Hours] [Max. Marks : 70
0
1/2
.23 GP

Instructions: 1) Solve Q1 or Q2, Q3 or Q4, Q5 or Q6, Q7 or Q8.


2) Figures to the right indicate full marks.
E
81

3) Neat Diagrams must be wherever necessary.

8
C

23
4) Assume suitable data wherever necessary.

ic-
16

tat
Q1) a) Define a function with suitable example? Explain need for a function. [6]
8.2

4s
b) Differentiate between local and global variables. [6]
.24

5:3
91
c) Write a program using function to find square of a number. [5]
49

3:3
30

OR
41

Q2) a) Explain the following types of function arguments with examples: [6]
01
02

i) default arguments ii) keyword arguments


1/2
GP

b) Explain user defined module and package in Python. [6]


0/0

c) Write a program to perform addition of two numbers using lambda


CE
81

8
function. [5]

23
.23

ic-
Q3) a) Explain string indexing and slicing with suitable example. [6]
16

tat
b) Explain the following with suitable example. [6]
8.2

4s

i) ord() and chr() function ii) in and not in operators on string


.24

5:3

c) What is the output of the following statement for the given string?
91
49

3:3

st = “Python is an interpreted programming language” [5]


30
41

i) print (st [12:20])


01
02

ii) print (st [:: – 1])


1/2
GP
0/0

iii) print ("an" not in st)


CE
81

iv) print (st [17])


.23

v) print (st [0:23])


16
8.2

P.T.O.
.24
49
8
OR

23
ic-
Q4) a) Explain string format method with suitable example. [6]

tat
4s
b) Explain following string methods with example. [6]

5:3
i) title()

02 91
3:3
0
ii) capitalize()

41
0/0 13
iii) lower()
0
1/2
.23 GP

c) Write a program to display a string and count characters in the string


using a loop. [5]
E
81

8
C

23
Q5) a) What is programming paradigm? Explain the following Programming

ic-
Paradigms in detail [6]
16

tat
8.2

4s
i) Monolithic Programming
.24

5:3
91
ii) Procedural Programming
49

3:3
30

b) Explain the following concepts with example. [6]


41
01
02

i) Object variable
1/2
GP

ii) class variable


0/0
CE
81

8
c) Write a python program to create a class Employee with the attributes

23
.23

Name, emp_id, and salary and display data of 2 employees. [6]


ic-
16

tat
OR
8.2

4s
.24

Q6) a) Explain the following features [6]


5:3
91
49

3:3

i) Class
30
41

ii) Inheritance
01
02
1/2

iii) Polymorphism
GP
0/0

b) Explain class method and self-object with suitable example. [6]


CE
81

c) Write a program to create class Car with two attributes name and cost.
.23

Create 3 objects and display information. [6]


16
8.2
.24

[6178]-8 2
49
Q7) a) What is a file? Explain relative and absolute path of a file. [6]

8
23
ic-
b) Explain the following file handling methods. [6]

tat
4s
i) write()

5:3
02 91
ii) tell()

3:3
0
41
iii) seek()
0/0 13
0
c) Explain the following file access modes
1/2 [6]
.23 GP

i) r ii) w iii) a iv) rb v) wb vi) r+


E
81

8
C

23
OR

ic-
16

Q8) a) Explain any 3 directory methods with example. [6]

tat
8.2

4s
.24

5:3
b) Explain text and binary files with example. [6]
91
49

3:3
30
41

c) Explain any 3 dictionary methods with example. [6]


01
02
1/2
GP
0/0
CE
81

8
23
.23

  
ic-
16

tat
8.2

4s
.24

5:3
91
49

3:3
30
41
01
02
1/2
GP
0/0
CE
81
.23
16
8.2
.24

[6178]-8 3
49

You might also like