Pps End Sem Question Paper
Pps End Sem Question Paper
8
23
P-9073 [Total No. Of Pages : 3
ic-
tat
[6178] - 8
4s
F.E.
5:3
02 91
Programming and Problem Solving
3:3
0
41
(2019 Pattern) (Semester - I) (110005)
0/0 13
Time :2½ Hours] [Max. Marks : 70
0
1/2
.23 GP
8
C
23
4) Assume suitable data wherever necessary.
ic-
16
tat
Q1) a) Define a function with suitable example? Explain need for a function. [6]
8.2
4s
b) Differentiate between local and global variables. [6]
.24
5:3
91
c) Write a program using function to find square of a number. [5]
49
3:3
30
OR
41
Q2) a) Explain the following types of function arguments with examples: [6]
01
02
8
function. [5]
23
.23
ic-
Q3) a) Explain string indexing and slicing with suitable example. [6]
16
tat
b) Explain the following with suitable example. [6]
8.2
4s
5:3
c) What is the output of the following statement for the given string?
91
49
3:3
P.T.O.
.24
49
8
OR
23
ic-
Q4) a) Explain string format method with suitable example. [6]
tat
4s
b) Explain following string methods with example. [6]
5:3
i) title()
02 91
3:3
0
ii) capitalize()
41
0/0 13
iii) lower()
0
1/2
.23 GP
8
C
23
Q5) a) What is programming paradigm? Explain the following Programming
ic-
Paradigms in detail [6]
16
tat
8.2
4s
i) Monolithic Programming
.24
5:3
91
ii) Procedural Programming
49
3:3
30
i) Object variable
1/2
GP
8
c) Write a python program to create a class Employee with the attributes
23
.23
tat
OR
8.2
4s
.24
3:3
i) Class
30
41
ii) Inheritance
01
02
1/2
iii) Polymorphism
GP
0/0
c) Write a program to create class Car with two attributes name and cost.
.23
[6178]-8 2
49
Q7) a) What is a file? Explain relative and absolute path of a file. [6]
8
23
ic-
b) Explain the following file handling methods. [6]
tat
4s
i) write()
5:3
02 91
ii) tell()
3:3
0
41
iii) seek()
0/0 13
0
c) Explain the following file access modes
1/2 [6]
.23 GP
8
C
23
OR
ic-
16
tat
8.2
4s
.24
5:3
b) Explain text and binary files with example. [6]
91
49
3:3
30
41
8
23
.23
ic-
16
tat
8.2
4s
.24
5:3
91
49
3:3
30
41
01
02
1/2
GP
0/0
CE
81
.23
16
8.2
.24
[6178]-8 3
49
Total No. of Questions : 8] SEAT No. :
8
23
PB3593 [Total No. of Pages : 3
ic-
[6260]-8
tat
F.E.
0s
PROGRAMMING AND PROBLEM SOLVING
3:5
(2019 Pattern) (Credit System) (Semester - I/II) (110005)
02 91
9:3
Time : 2½ Hours] [Max. Marks : 70
0
40
0/0 13
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.
0
2) Neat diagrams must be drawn weherver necessary.
5/2
.23 GP
8
C
23
b) Explain how we can pass command line arguments in python with a
ic-
suitable example. [6]
16
tat
8.2
0s
using a function. [5]
.24
3:5
91
49
OR
9:3
30
40
Q2) a) Write syntax of function definition and function call. Give a suitable
example for the same. [6]
01
02
5/2
8
23
.23
tat
8.2
0s
.24
3:5
9:3
i) concatenation
30
40
ii) appending
01
02
OR
8.2
.24
P.T.O.
49
[6260]-8 1
Q4) a) Explain string module in python. [6]
8
23
b) Explain following string methods with example. [6]
ic-
i) split()
tat
0s
ii) zfill()
3:5
iii) replace()
02 91
9:3
c) Write a program to reverse a string without using slicing operator. [5]
0
40
0/0 13
0
Q5) a) Explain the following programming Paradigms in detail.
5/2 [6]
.23 GP
i) Procedural
E
ii) Structured
83
8
C
23
iii) Object Oriented
ic-
16
tat
8.2
0s
c) Write a program to create a class ‘Book’ with members, title, author,
.24
3:5
publisher, and ISBN number. The functions of the class should read and
91
49
OR
01
02
8
iii) Inheritance
23
.23
tat
c) Write a program to calculate area of square and rectangle using a class.[6]
8.2
0s
.24
3:5
91
49
i) seek()
5/2
GP
ii) writelines()
0/0
iii) readline()
CE
83
c) Write a program that reads text from a file and writes in into another file
.23
but in the reverse order. (Hint: Make the first line in the original file as the
16
OR
.24
49
[6260]-8 2
Q8) a) Explain the following method with suitable example [6]
8
23
i) getcwd()
ic-
tat
ii) rmtree()
0s
3:5
iii) makedirs()
02 91
9:3
0
b) What is a file path? Explain absolute path and relative path. [6]
40
0/0 13
c) Explain the following dictionary methods. [6]
0
5/2
.23 GP
i) fromkeys()
E
83
8
C
23
ii) setdefault()
ic-
16
iii) update()
tat
8.2
0s
.24
3:5
91
49
9:3
30
40
01
02
5/2
GP
0/0
CE
83
8
23
.23
ic-
16
tat
8.2
0s
.24
3:5
91
49
9:3
30
40
01
02
5/2
GP
0/0
CE
83
.23
16
8.2
.24
49
[6260]-8 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
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
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
i) local variable
01
02
8/2
[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
0:4
P.T.O.
.24
49
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
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
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
c) Write a python program to create a class Student with the attributes Name,
01
02
OR
2/0
b) Explain class method and class variable with suitable example. [6]
.23
[6001]-4008 2
49
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
8
C
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
https://www.studymedia.in/fe/notes
Total No. of Questions : 9] SEAT No. :
PA-4300 [Total No. of Pages : 3
[5924]-9
F.E.
PROGRAMMING AND PROBLEM SOLVING
( 2019 Pattern) (Semester-II) (110005)
Q1) [10]
a) Which of the following keyword is used in user defined function header
in Python?
i) define ii) def
iii) function iv) fun
b) Which one of the following is the correct way of calling a function?
i) f_name() ii) call f_name()
iii) return f_name() iv) function f_name()
c) Which function is used to convert a numeric value to a character.
i) ord() ii) chr()
iii) input() iv) output()
d) What is the correct file extension for python files?
i) .pt ii) .pyt
iii) .py iv) .cpp
e) Which method can be used to return a string in upper case letters?
i) toupper() ii) upper()
iii) uppercase() iv) touppercase()
f) Which method is automatically executed when an object of a class is
created?
i) _init_() ii) _call_()
iii) _repr_() iv) _del_()
P.T.O.
Q2) a) Define a function. Explain function definition and function call with an
example. [6]
b) What do you mean by local and global variables? Explain it with example.[5]
c) Write a program to swap two numbers using a function. [4]
OR
Q3) a) Explain the following types of function arguments with examples: [6]
i) Required arguments
ii) Keyword arguments
b) What is a lambda function? Explain it with a suitable example. [5]
c) What are the good Python programming practices? [4]
Q4) a) Explain any three string operations with suitable example. [6]
b) Explain slicing operation on string with suitable example. [5]
c) Write a program to count the number of characters and words in the given
string. s= “Programming and Problem Solving” [4]
OR
[5924]-9 2
Q8) a) What is a file? Differentiate between text and binary file. [6]
b) What is a dictionary? Explain how to create and access dictionary
elements. [5]
c) Explain relative and absolute path of a file. [4]
OR
Q9) a) Explain any three methods for reading and writing files. [6]
b) Explain different directory methods with suitable examples. [5]
c) Write a program to copy the contents of one file to another file. [4]
[5924]-9 3
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.
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
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
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