You are on page 1of 3

Total No. of Questions : 8] SEAT No.

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

Instructions to the candidates :


1) Solve Q.1 or Q.2, Q.3 or Q.4, Q.5 or Q.6, Q.7 or Q.8.
E

2) Neat diagrams must be drawn wherever necessary.


80

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

c) Write python program using function to find greatest of three numbers


00

by passing numbers as argument. [6]


01
02
1/2

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

c) Write python program using function to find whether number is odd or


.24

2:5

even. [6]
91
49

9:4
30
00
01

Q3) a) Explain following string methods with example. [6]


02
1/2
GP

i) Rindex
2/0

ii) Z fill
CE
80

iii) Split
.23
16

b) Write a python program to display tables from 1 to 10 using formatting


8.2

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

Q4) a) Explain following string methods with example : [6]


i) Join
E
80

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

not use built in string method. [6]


9:4
30
00

c) Write a python program to check whether a given string starts with


01
02

specified character. [5]


1/2
GP
2/0

Q5) a) Define programming paradigm. List programming paradigms. Explain


CE
80

8
any one. [6]

23
.23

b) Justify the statement “Inheritance helps to make reusable code”.


ic-
[6]
16

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

Q6) a) Explain following Terms : [6]


01
02

i) Data Abstraction & Encapsulation


1/2
GP

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

cost. Create two objects and display information. [6]


.24

[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

b) Write a python program to display current directory, create directory


and remove created directory. [6]
E
80

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

You might also like