Professional Documents
Culture Documents
PPS Pyq 2
PPS Pyq 2
PPS Pyq 2
8
23
P6995 [Total No. of Pages : 4
ic-
[5868]-107
tat
6s
F.E. (Semester - I & II)
0:1
110005 : PROGRAMMING AND PROBLEM SOLVING
02 91
8:4
(2019 Pattern) (Common)
0
20
8/0 13
Time : 2½ Hours] [Max. Marks : 70
0
8/2
Instructions to the candidates:
.23 GP
8
C
23
3) Neat diagrams must be wherever necessary.
ic-
4) Assume suitable data wherever necessary.
16
tat
8.2
6s
.24
0:1
Q1) i) Which one of the following is the correct way of calling a function?
91
49
8:4
a) f_name() b) call f_name()
30
20
a) .pt b) .pyt
CE
80
8
23
c) .py d) .cpp
.23
ic-
16
6s
a) ord() b) chr()
.24
0:1
91
c) input() d) output()
49
8:4
30
20
iv) Which is the default access mode in the open () function for files in
01
Python?
02
8/2
GP
a) w b) r
8/0
c) a d) w+
CE
80
a) toupper() b) upper()
8.2
c) uppercase() d) touppercase()
.24
49
P.T.O.
vi) Which method is automatically executed when an object of a class is
8
created?
23
ic-
a) _init_() b) _call_()
tat
c) _repr_() d) _del_()
6s
0:1
vii) You can use Python for
02 91
8:4
a) Application programming b) Web programming
0
20
c) 8/0 13
Artificial intelligence d) All of these
0
8/2
viii)Which of the following keyword is used in user defined function header
.23 GP
in Python?
E
80
8
a) define b) def
C
23
ic-
c) function d) fun
16
tat
ix) What does open() function return?
8.2
6s
.24
a) function b) variable
0:1
91
49
8:4
c) file object d) none of these
30
20
a) close(file) b) close(“file”)
8/2
GP
8/0
c) file.closed() d) file.close()
CE
80
8
23
.23
Q2) a) Define a function. Explain function definition and function call with
ic-
16
tat
suitable example. [6]
8.2
6s
0:1
91
49
[4]
30
20
OR
01
02
i) Required arguments
8/0
CE
example. [5]
8.2
[5868]-107 2
Q4) a) Explain the following string operations with suitable example. [6]
8
23
i) Concatenation
ic-
tat
ii) Appending
6s
iii) String repetition
0:1
02 91
8:4
b) Explain indexing and slicing operation on string with suitable example.
0
20
8/0 13 [5]
8
C
23
OR
ic-
16
tat
Q5) a) Explain following string methods with example. [6]
8.2
6s
.24
0:1
i) strip()
91
49
8:4
ii) index()
30
20
iii) isdigit()
01
02
8/2
GP
[4]
80
8
23
.23
ic-
16
tat
Q6) a) Explain any three programming paradigms. [6]
8.2
6s
0:1
91
[5]
49
8:4
30
20
OR
8/2
GP
i) Data encapsulation
.23
iii) Polymorphism
.24
49
[5868]-107 3
b) Explain class variables and object variable with suitable example. [5]
8
23
c) Write a program to create a class ‘Employee’ with two attributes.
ic-
Display the details of two employees. [4]
tat
6s
0:1
02 91
Q8) a) What is a file? Explain different access modes for opening files. [6]
8:4
0
20
b) What is a dictionary? How to create, access and modify dictionary
elements.
8/0 13 [5]
0
8/2
.23 GP
OR
E
80
8
C
23
Q9) a) Explain any three methods for reading and writing files. [6]
ic-
16
tat
b) Explain different directory methods with suitable examples. [5]
8.2
6s
.24
0:1
c) Write a program to read first 10 characters from the file and display it.
91
49
[4]
8:4
30
20
01
02
8/2
GP
8/0
CE
80
8
23
.23
ic-
16
tat
8.2
6s
.24
0:1
91
49
8:4
30
20
01
02
8/2
GP
8/0
CE
80
.23
16
8.2
.24
49
[5868]-107 4