Skip to content

BPLCK105B / BPLCK205B · 2022 · First year · Semesters 1 / 2

Introduction to Python Programming

Same subject in either semester, depending on your cycle. Papers retain their original subject codes.

Back to subjects

Automated PYQ shortlist · Academic review pending. Questions are displayed from OCR. Some formulas and figures may need review.

Review status & sources

Similar question wording is grouped and ranked by the number of distinct exam sessions. Groups with the same count are ordered by their extracted text. Some subjects have only one session. Paper references show the PDF page and extracted question number when available.

Module 1

Define Exception and illustrate the concept of exception handling in Python using suitable example.

1 exam session
  • June-July-2025 · PDF page 1 · Q1c

Define functions. Explain how to pass parameters through the function with return statement. What is exception? How exception are handled in python? Write a program to solve divide by zero exception. Develop a program to generate Fibonacci sequence of length (N). Read N from the console.

OCR transcription · Wording, symbols, or figures may be incomplete.

1 exam session
  • Dec-2024-Jan-2025 · PDF page 1 · Q2

Define the rules to develop a user-defined function in Python and defne a function called exchange() to swap two numbers. show the output.

1 exam session
  • June-July-2025 · PDF page 1 · Q2
Show 2 Backup Questions

Develop a program in Python to tind the sum of n natural numbers. Read the number from user.

OCR transcription · Wording, symbols, or figures may be incomplete.

1 exam session
  • June-July-2025 · PDF page 1 · Q1b

Develop a program to calculate factorial of a number. Program to compute binomial coefficient (Given N and R).

OCR transcription · Wording, symbols, or figures may be incomplete.

1 exam session
  • Dec-2024-Jan-2025 · PDF page 1 · Q1c

Module 2

Describe Lists in Phython and examples to create list, list concatenation and replication. Write a function named displayInventory( ) that would take any possible "inventory" and display it like the following : Inventory : 12 arrow, 42 gold coin, 1 rope, 6 torch, 1 dagger, Total number of items : 62

OCR transcription · Wording, symbols, or figures may be incomplete.

1 exam session
  • June-July-2025 · PDF page 1 · Q4a

Develop a program to find mean, variance and standard deviation.

OCR transcription · Wording, symbols, or figures may be incomplete.

1 exam session
  • Dec-2024-Jan-2025 · PDF page 1 · Q3c

Develop a python to print area of rectangle. Define pretty printing. How does pretty print work in python with an example

OCR transcription · Wording, symbols, or figures may be incomplete.

1 exam session
  • Dec-2024-Jan-2025 · PDF page 1 · Q4b
Show 2 Backup Questions

Explain Augmented short hand assignment operators with an example. Explain ditferent type of methods like append(), Remove(), sort(), pop() in python programming list.

1 exam session
  • Dec-2024-Jan-2025 · PDF page 1 · Q3

Explain set() and setdefault() method in dictionary.

1 exam session
  • Dec-2024-Jan-2025 · PDF page 1 · Q4

Module 3

Differentiate between absolute and relative paths in specitying fue palhs

OCR transcription · Wording, symbols, or figures may be incomplete.

1 exam session
  • June-July-2025 · PDF page 2 · Q5c

Discuss various methods available to remove the white spaces in a string with examples.

1 exam session
  • June-July-2025 · PDF page 2 · Q5b

Explain OS path module with an example. Explain the concept of file path. Also discuss absolute and relative file path Program to print of multi clipboard with appropriate message.

1 exam session
  • Dec-2024-Jan-2025 · PDF page 2 · Q6
Show 2 Backup Questions

Explain useful string functions like : ı) Capitalize ii) Count iii) Find iv) Lower v) Upper vi) Replace with an example. Develop a python code to determine whether given string is a palindrome or not a palindrome. Explain : i) isalpha ii) isalnum iii) isspace().

OCR transcription · Wording, symbols, or figures may be incomplete.

1 exam session
  • Dec-2024-Jan-2025 · PDF page 1 · Q5a

List the string methods to analyze strings. Explain any four with syntax and examples. Explain how to save and retrieve variables with the Shelve module

OCR transcription · Wording, symbols, or figures may be incomplete.

1 exam session
  • June-July-2025 · PDF page 2 · Q6b

Module 4

Briefly explain assertion and raising a exception. List out the benefits of using logging module with an example. Write a function named DivExp which takes two parameters a, b and returns a value C(c a/b). Write suitable assertion for a 70 in function DivExp and raise an exception for when b = 0. Develop a suitable program which reads two values from the console and calls a function DivExp.

OCR transcription · Wording, symbols, or figures may be incomplete.

1 exam session
  • Dec-2024-Jan-2025 · PDF page 2 · Q8

Describe how Raise exception is done using an example. Differentiate between Step over, Step In and Step Out buttons in the

OCR transcription · Wording, symbols, or figures may be incomplete.

1 exam session
  • June-July-2025 · PDF page 2 · Q8b

Develop a program to backing up a given folder (folder in a current working directory) into a zip file by using relevant modules and suitable methods. List out the difference between shutil.copy() and shutil.copythree() method Explain the following file operations in pythons with suitable example: i) Copying files and folders ii) Moving files and folders iii) Permanently deleting files and folders.

OCR transcription · Wording, symbols, or figures may be incomplete.

1 exam session
  • Dec-2024-Jan-2025 · PDF page 2 · Q7a
Show 2 Backup Questions

Discuss how shutil module helps to perform the operations such as copy, move, rename and delete files.

1 exam session
  • June-July-2025 · PDF page 2 · Q7a

Explain the backing up a folder into a zip, with a program code

OCR transcription · Wording, symbols, or figures may be incomplete.

1 exam session
  • June-July-2025 · PDF page 2 · Q8a

Module 5

Define a function which takes two objects representing complex numbers and returns a new complex number with a addition of two complex numbers. Define a suitable class 'complex' to represent the complex number. Develop a program to read N(N > = 2) complex numbers and compute the addition of 10 complex numbers. Explain the concept of inheritance with an example.

OCR transcription · Wording, symbols, or figures may be incomplete.

2 exam sessions
  • Dec-2024-Jan-2025 · PDF page 2 · Q9
  • June-July-2025 · PDF page 2 · Q9b

. Differentiate between the class method and instance method with suitable program exampies.

OCR transcription · Wording, symbols, or figures may be incomplete.

1 exam session
  • June-July-2025 · PDF page 2 · Q9a

Define a class and object, construct the class called rectangle and initialize it with height = 100, width = 200, starting point as (x = 0, y = 0). Write a program to display the centre pint co-ordinates of a rectangle. Briefly explain the printing of objects with an example.

OCR transcription · Wording, symbols, or figures may be incomplete.

1 exam session
  • Dec-2024-Jan-2025 · PDF page 2 · Q10
Show 2 Backup Questions

Differentiate operator over loading and operator overriding in python.

1 exam session
  • Dec-2024-Jan-2025 · PDF page 2 · Q10c

Explain the_ str_and the_init_method with an example.

OCR transcription · Wording, symbols, or figures may be incomplete.

1 exam session
  • Dec-2024-Jan-2025 · PDF page 2 · Q9c