Professional Documents
Culture Documents
8
23
P4937 [Total No. of Pages : 3
ic-
[5667]-1008
tat
9s
F.E. (Semester - I)
2:5
PROGRAMMING & PROBLEM SOLVING
02 91
9:4
(2019 Pattern)
0
00
2/0 13
Time : 3 Hours] [Max. Marks : 70
0
1/2
.23 GP
8
C
23
3) Assume suitable data wherever necessary.
ic-
16
tat
Q1) a) What is function? Explain code reuse. Explain with example Docstring.
8.2
9s
[6]
.24
2:5
91
b) Explain Lambda function with example. [6]
49
9:4
30
OR
GP
2/0
Q2) a) Differentiate between Local & Global variable. Write a python program
CE
80
8
to demonstrate difference between local and global variable. [6]
23
.23
ic-
b) Explain keyword arguments in python. Write a python program to
16
tat
demonstrate keyword arguments. [6]
8.2
9s
2:5
even. [6]
91
49
9:4
30
00
01
i) Rindex
2/0
ii) Z fill
CE
80
iii) Split
.23
16
character. [6]
.24
P.T.O.
49
c) What will be the output of following statement S = “Welcome to Python”.
8
23
[5]
ic-
i) Print (s[1:9])
tat
ii) Print (s[ :6])
9s
iii) Print (s[4: ])
2:5
02 91
iv) Print (s[1: –1])
9:4
0
v) Print (“Come” not in str)
00
2/0 13 OR
0
1/2
.23 GP
8
C
23
ii) Enumerate
ic-
16
iii) 1 strip
tat
8.2
9s
b) Write python, program to find whether a given character is present in a
.24
2:5
string or not. In case it is present print the index at which it is present. Do
91
49
8
any one. [6]
23
.23
tat
8.2
c) Write a python program that uses class to store exam number and marks
9s
of four subjects. Use list to store the marks of four subjects. [6]
.24
2:5
91
49
9:4
OR
30
00
ii) Polymorphism
2/0
CE
80
b) With the help of an example explain the significance of the inif ( ) method.
.23
[6]
16
c) Write a python program to create class car with two attributes name &
8.2
[5667]-1008 2
49
Q7) a) Write a python program that reads data from one file and write into
8
23
another file and line by line. [6]
ic-
b) What is directory? List any four directory methods and explain any two
tat
of them. [6]
9s
2:5
c) Why do we need files? Explain relative and absolute path in files. [5]
02 91
9:4
OR
0
00
Q8) a) 2/0 13
Write a python program that counts the number of tabs and new line
characters in a file. [6]
0
1/2
.23 GP
8
C
23
c) Differentiate between text and binary files. Explain any 4 access modes
ic-
used in python. [5]
16
tat
8.2
9s
.24
2:5
91
49
9:4
30
00
01
02
1/2
GP
2/0
CE
80
8
23
.23
ic-
16
tat
8.2
9s
.24
2:5
91
49
9:4
30
00
01
02
1/2
GP
2/0
CE
80
.23
16
8.2
.24
[5667]-1008 3
49