Programming and Problem Solving (PPS) SPPU Endsem Question Paper May 2022
All 9 questions from this SPPU endsem paper, as printed. Read them here or open the PDF.
- Pattern
- 2019 pattern
- Exam
- Endsem
- Session
- May 2022
- Max. marks
- 70
- Time
- 2½ Hours
- Paper code
- [5868]-107
Printed for: F.E. (Semester - I & II)
Instructions to the candidates
- Question one is compulsory.
- Solve Q2 or Q3, Q4 or Q5, Q6 or Q7, Q8 or Q9.
- Neat diagrams must be wherever necessary.
- Assume suitable data wherever necessary.
Questions
Q1
i) Which one of the following is the correct way of calling a function?
- a)
f_name() b) call f_name()
- c)
return f_name() d) function f_name() ii) What is the correct file extension for Python files?
- a)
This part has equations that don’t show as text. Open the PDF to read it.
- c)
.py d) .cpp iii) Which function is used to convert a numeric value to a character.
- a)
ord() b) chr()
- c)
input() d) output() iv) Which is the default access mode in the open () function for files in Python?
- a)
This part has equations that don’t show as text. Open the PDF to read it.
- c)
This part has equations that don’t show as text. Open the PDF to read it.
- a)
toupper() b) upper()
- c)
uppercase() d) touppercase() vi) Which method is automatically executed when an object of a class is created?
- a)
_init_() b) _call_()
- c)
_repr_() d) _del_() vii) You can use Python for
- a)
Application programming b) Web programming
- c)
Artificial intelligence d) All of these viii) Which of the following keyword is used in user defined function header in Python?
- a)
define b) def
- c)
function d) fun ix) What does open() function return?
- a)
function b) variable
- c)
file object d) none of these x) Which of the following is the correct way of closing a file?
- a)
close(file) b) close(“file”)
- c)
file.closed() d) file.close()
Q2
- a)[6]
Define a function. Explain function definition and function call with suitable example.
- b)[5]
What is a lambda function? Explain with a suitable example.
- c)[4]
What are the good Python programming practices?
Also asked:Nov 2024
OR- a)
Q3
- a)[6]
Explain the following types of function arguments with examples: i) Required arguments ii) Keyword arguments
- b)[5]
What do you mean by local and global variables? Explain it with example.
- c)[4]
Write a program to swap two numbers using a function.
- a)
Q4
- a)[6]
Explain the following string operations with suitable example. i) Concatenation ii) Appending iii) String repetition
- b)[5]
Explain indexing and slicing operation on string with suitable example.
Also asked:Nov 2023
- c)[4]
Write a program to count the number of characters and words in the given string. s = “Welcome to the world of python programming”
OR- a)
Q5
Q6
- a)[6]
Explain any three programming paradigms.
- b)[5]
Define a class in Python. Explain_init_() method with suitable example.
- c)[4]
Explain the concept of a class and an object in OOP.
OR- a)
Q7
- a)[6]
Explain the following features of Object Oriented Programming. i) Data encapsulation ii) Data abstration iii) Polymorphism
- b)[5]
Explain class variables and object variable with suitable example.
- c)[4]
Write a program to create a class ‘Employee’ with two attributes. Display the details of two employees.
- a)
Q8
ORQ9
- a)[6]
Explain any three methods for reading and writing files.
- b)[5]
Explain different directory methods with suitable examples.
Also asked:May 2023
- c)[4]
Write a program to read first 10 characters from the file and display it.
- a)