You are on page 1of 3

Total No. of Questions : 8] SEAT No.

8
23
P-3664 [Total No. of Pages : 3

ic-
tat
[6001]-4008

2s
F.E. (Semester - II)

6:5
02 91
0:4
PROGRAMMING AND PROBLEM SOLVING

0
31
(2019 Pattern) (110005)
2/0 13
0
Time : 2½ Hours] [Max. Marks : 70
8/2
.23 GP

Instructions to the candidates :


1) Question one is compulsory.
E
80

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

23
3) Neat diagrams must be wherever necessary.

ic-
16

4) Assume suitable data wherever necessary.

tat
8.2

2s
.24

Q1) a) Explain in-built and user defined functions with syntax and suitable
6:5
91
example. [6]
49

0:4
30

b) Explain the following terms with suitable examples. [6]


31

i) local variable
01
02
8/2

ii) global variable


GP
2/0

c) Write a program to check whether a number is prime or not using function.


CE

[5]
80

8
23
OR
.23

Q2) a) Explain the following types of function arguments with examples: [6] ic-
16

tat
8.2

i) positional arguments
2s
.24

6:5

ii) variable length arguments


91
49

0:4

b) Explain different ways of importing an in-built module in python with


30

suitable example. [6]


31
01

c) Write a program to find cube of a number using lambda function. [5]


02
8/2
GP
2/0

Q3) a) Justify strings are immutable with example. [6]


CE
80

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


.23

i) ord() and chr() function


16

ii) in and not in operators on string


8.2

P.T.O.
.24
49
c) What is the output of the following statement for the given string? [5]

8
23
S = “Programming and Problem Solving”

ic-
i) print(S[:11])

tat
2s
ii) print(S[::-1])

6:5
iii) print("And" not in S)

02 91
0:4
iv) print(S[4])

0
31
v) 2/0 13
print (S[0:10])
0
8/2
OR
.23 GP

Q4) a) Explain string format operator with suitable example. [6]


E
80

8
b) Explain following string methods with example. [6]
C

23
ic-
i) title()
16

tat
ii) startswith()
8.2

2s
iii) zfill()
.24

6:5
91
49

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


0:4
30

using a loop. [5]


31
01
02
8/2

Q5) a) Explain the following Programming Paradigms in detail. [6]


GP
2/0

i) Monolithic Programming
CE
80

8
ii) Structured Programming

23
.23

ic-
iii) Object Oriented Programming
16

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

2s
.24

i) public members
6:5
91
49

0:4

ii) private members


30
31

c) Write a python program to create a class Student with the attributes Name,
01
02

roll no and age and display data of 4 students. [6]


8/2
GP

OR
2/0

Q6) a) Explain any three object oriented features in brief. [6]


CE
80

b) Explain class method and class variable with suitable example. [6]
.23

c) Write a program to calculate area of triangle using a class. [6]


16
8.2
.24

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

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

ic-
i) write()

tat
2s
ii) writelines()

6:5
02 91
ii) close()

0:4
0
c) Explain file access modes in brief. [6]

31
2/0 13 OR
0
8/2
Q8) a) Explain different directory methods with example. [6]
.23 GP

b) Differentiate between text and binary files. [6]


E
80

8
C

c) Explain the following dictionary methods. [6]

23
ic-
i) update()
16

tat
8.2

ii) keys()

2s
.24

6:5
iii) pop()
91
49

0:4
30


31
01
02
8/2
GP
2/0
CE
80

8
23
.23

ic-
16

tat
8.2

2s
.24

6:5
91
49

0:4
30
31
01
02
8/2
GP
2/0
CE
80
.23
16
8.2
.24

[6001]-4008 3
49

You might also like