Programming in Python — End Sem 2025

Programming in Python (BTCS 510-18) End Sem 2025 question paper from I.K. Gujral Punjab Technical University. Read it online or download the PDF; an answer key is included.

Questions in this paper

  1. Name two built-in Python modules commonly used in data analysis. — 2 marks
  2. Explain the difference between string indexing and string slicing with examples. — 2 marks
  3. Name two methods used to write data into a file in Python. — 2 marks
  4. Illustrate how the "with" statement is used in file handling and why it is preferred over explicitly calling close ( ). — 2 marks
  5. Which Python statement is used to start a new thread using the thread module? — 2 marks
  6. Explain the acronym GIL in Python. — 2 marks
  7. Name any one Python library used for web clients. — 2 marks
  8. Demonstrate the process of establishing a client-server connection. — 2 marks
  9. Why do we need Python for database programming? — 2 marks
  10. Explain two Python modules that support DB-API. — 2 marks
  11. Identify the difference between strings, list and tuples. — 5 marks
  12. Compare the behavior of code execution when using try-except alone versus try-except-else. — 5 marks
  13. Explain the difference between threads and processes in Python with suitable examples. — 5 marks
  14. Construct a menu in Tkinter applications and explain with an example. — 5 marks
  15. Explain the importance DB-API and Object Relational Managers (ORMs). Write an example using SQL Alchemy to define a model, insert records, and query them. — 10 marks
  16. Analyze the use of built-in modules versus user-defined modules in terms of reusability, performance, and scalability. — 10 marks
  17. Identify the difference between various types of GUI's. — 10 marks
  18. Elaborate the role of web servers (HTTP Servers) in managing client-server communication efficiency in Python web programming. — 10 marks

Other Programming in Python papers

Related