PPS Pyq 3

You might also like

Download as pdf or txt
Download as pdf or txt
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
PROGRAMMING AND PROBLEM SOLVING

0:4
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-
4) Assume suitable data wherever necessary.
16

tat
8.2

2s
Q1) a) Explain in-built and user defined functions with syntax and suitable
.24

6:5
02 91
example. [6]
49

0:4
b) Explain the following terms with suitable examples. [6]
0
31
3

i) local variable
0 1

ii) global variable


8/2
P

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


G
2/0

[5]
E
80

8
C

23
OR
.23

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

tat
8.2

i) positional arguments
2s
.24

ii) variable length arguments


6:5
02 91
49

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


0:4
0

suitable example. [6]


31
3

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


0 1
8/2
.23 GP
2/0

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


E
80

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


C

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) print (S[0:10]) 2/0 13
0
OR
8/2
.23 GP

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


E
80

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

8
C

23
i) title()

ic-
16

tat
ii) startswith()
8.2

2s
iii) zfill()
.24

6:5
02 91
c) Write a program to display a string and count characters in the string
49

0:4
using a loop. [5]
0
31
1 3
0
8/2

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


G P
2/0

i) Monolithic Programming
E
80

8
ii) Structured Programming
C

23
.23

iii) Object Oriented Programming


ic-
16

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

2s

i) public members
.24

6:5
02 91
49

ii) private members


0:4
0
31

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

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


0 1
8/2

OR
.23 GP
2/0

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


E
80

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

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
ii) close()

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

0
31
OR
2/0 13
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) Explain the following dictionary methods. [6]
C

23
ic-
i) update()
16

tat
ii) keys()
8.2

2s
.24

6:5
iii) pop()
02 91
49

0:4
0


31
1 3
0
8/2
G P
2/0
E
80

8
C

23
.23

ic-
16

tat
8.2

2s
.24

6:5
02 91
49

0:4
0
31
1 3
0
8/2
.23 GP
2/0
E
80
.24
8.2
16
C

[6001]-4008 3
49

You might also like