Skip to content
EndsemMay 20222019 patternFE

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

  1. Question one is compulsory.
  2. Solve Q2 or Q3, Q4 or Q5, Q6 or Q7, Q8 or Q9.
  3. Neat diagrams must be wherever necessary.
  4. Assume suitable data wherever necessary.

Questions

  1. Q1

    1. i) Which one of the following is the correct way of calling a function?

    2. a)

      f_name() b) call f_name()

    3. c)

      return f_name() d) function f_name() ii) What is the correct file extension for Python files?

    4. a)

      This part has equations that don’t show as text. Open the PDF to read it.

    5. c)

      .py d) .cpp iii) Which function is used to convert a numeric value to a character.

    6. a)

      ord() b) chr()

    7. c)

      input() d) output() iv) Which is the default access mode in the open () function for files in Python?

    8. a)

      This part has equations that don’t show as text. Open the PDF to read it.

    9. c)

      This part has equations that don’t show as text. Open the PDF to read it.

    10. a)

      toupper() b) upper()

    11. c)

      uppercase() d) touppercase() vi) Which method is automatically executed when an object of a class is created?

    12. a)

      _init_() b) _call_()

    13. c)

      _repr_() d) _del_() vii) You can use Python for

    14. a)

      Application programming b) Web programming

    15. c)

      Artificial intelligence d) All of these viii) Which of the following keyword is used in user defined function header in Python?

    16. a)

      define b) def

    17. c)

      function d) fun ix) What does open() function return?

    18. a)

      function b) variable

    19. c)

      file object d) none of these x) Which of the following is the correct way of closing a file?

    20. a)

      close(file) b) close(“file”)

    21. c)

      file.closed() d) file.close()

  2. Q2

    1. a)

      Define a function. Explain function definition and function call with suitable example.

      [6]
    2. b)

      What is a lambda function? Explain with a suitable example.

      [5]
    3. c)

      What are the good Python programming practices?

      Also asked:Nov 2024

      [4]
  3. Q3

    1. a)

      Explain the following types of function arguments with examples: i) Required arguments ii) Keyword arguments

      Also asked:Nov 2025 ·May 2025 ·May 2024 ·Nov 2023 ·May 2023

      [6]
    2. b)

      What do you mean by local and global variables? Explain it with example.

      Also asked:Nov 2025 ·May 2025 ·Nov 2023 ·May 2023

      [5]
    3. c)

      Write a program to swap two numbers using a function.

      Also asked:Mar 2026 ·Nov 2025 ·Oct 2025 ·Sep 2024

      [4]
  4. Q4

    1. a)

      Explain the following string operations with suitable example. i) Concatenation ii) Appending iii) String repetition

      Also asked:Nov 2024 ·May 2024

      [6]
    2. b)

      Explain indexing and slicing operation on string with suitable example.

      Also asked:Nov 2023

      [5]
    3. c)

      Write a program to count the number of characters and words in the given string. s = “Welcome to the world of python programming”

      [4]
  5. Q5

    1. a)

      Explain following string methods with example. i) strip() ii) index() iii) isdigit()

      [6]
    2. b)

      What is a string? Explain with example iterating strings.

      [5]
    3. c)

      Explain ord() and chr() functions with suitable examples.

      Also asked:Feb 2026 ·Nov 2025 ·May 2025 ·Nov 2023 ·May 2023

      [4]
  6. Q6

    1. a)

      Explain any three programming paradigms.

      [6]
    2. b)

      Define a class in Python. Explain_init_() method with suitable example.

      [5]
    3. c)

      Explain the concept of a class and an object in OOP.

      [4]
  7. Q7

    1. a)

      Explain the following features of Object Oriented Programming. i) Data encapsulation ii) Data abstration iii) Polymorphism

      [6]
    2. b)

      Explain class variables and object variable with suitable example.

      Also asked:May 2025 ·Apr 2025 ·May 2024 ·Nov 2023

      [5]
    3. c)

      Write a program to create a class ‘Employee’ with two attributes. Display the details of two employees.

      [4]
  8. Q8

    1. a)

      What is a file? Explain different access modes for opening files.

      Also asked:Nov 2024 ·May 2024 ·May 2023

      [6]
    2. b)

      What is a dictionary? How to create, access and modify dictionary elements.

      [5]
    3. c)

      Explain relative and absolute path of a file.

      Also asked:Feb 2026 ·May 2025 ·Nov 2024 ·May 2024 ·Nov 2023 ·May 2023

      [4]
  9. Q9

    1. a)

      Explain any three methods for reading and writing files.

      [6]
    2. b)

      Explain different directory methods with suitable examples.

      Also asked:May 2023

      [5]
    3. c)

      Write a program to read first 10 characters from the file and display it. 

      [4]