Skip to content

1BPLC105B / 1BPLC205B · 2025 · First year · Semesters 1 / 2

Python Programming

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

Back to subjects

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

Compare the for and while loops in Python with examples.

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

View question scan & diagramsOriginal question scan, part 1
1 exam session
  • June/July 2026 · PDF page 1

Differentiate between a syntax error and a runtime error with examples.

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

View question scan & diagramsOriginal question scan, part 1
1 exam session
  • June/July 2026 · PDF page 1

What is meant by function composition? Illustrate with an example.

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

View question scan & diagramsOriginal question scan, part 1
1 exam session
  • June/July 2026 · PDF page 1
Show 2 Backup Questions

What is two-dimensional table? Explain the python code for printing multiples of table 2.

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

View question scan & diagramsOriginal question scan, part 1
1 exam session
  • June/July 2026 · PDF page 1

Write a python code to (i) count the number of decimal digits in a positive integer. (ii) count the number of O's or 5's in a positive integer.

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

View question scan & diagramsOriginal question scan, part 1
1 exam session
  • June/July 2026 · PDF page 1

Module 2

Develop a program to count the number of words in a given line of text.

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

View question scan & diagramsOriginal question scan, part 1
1 exam session
  • June/July 2026 · PDF page 1

Explain mutability in lists. Illustrate the difference between modifying a list and creating a clone of it using examples.

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

View question scan & diagramsOriginal question scan, part 1
1 exam session
  • June/July 2026 · PDF page 1

Explain the string operations in Python for slicing, concatenation, repetition, and comparison with suitable examples.

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

View question scan & diagramsOriginal question scan, part 1
1 exam session
  • June/July 2026 · PDF page 1
Show 2 Backup Questions

What is a tuple? Give example. Also explain tuple packing and unpacking with suitable examples.

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

View question scan & diagramsOriginal question scan, part 1
1 exam session
  • June/July 2026 · PDF page 1

Write a code snippet to explain string format method.

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

View question scan & diagramsOriginal question scan, part 1
1 exam session
  • June/July 2026 · PDF page 1

Module 3

Define a dictionary in Python. Explain dictionary methods like key() and values( ).

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

View question scan & diagramsOriginal question scan, part 1
1 exam session
  • June/July 2026 · PDF page 2

Develop a program to sort the contents of a text file and write the sorted contents into a separate text file. [Hint: Use string methods strip(), len(), list methods sort(), append(), and file methods open(), readlines(), and write()]

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

View question scan & diagramsOriginal question scan, part 1
1 exam session
  • June/July 2026 · PDF page 2

Explain del statement in python dictionary.

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

View question scan & diagramsOriginal question scan, part 1
1 exam session
  • June/July 2026 · PDF page 2
Show 2 Backup Questions

What is masking in NumPy? Develop a program to illustrate masking to filter array elements.

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

View question scan & diagramsOriginal question scan, part 1
1 exam session
  • June/July 2026 · PDF page 2

With example differentiate reading a file line-at-a-time and Reading the whole file at once.

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

View question scan & diagramsOriginal question scan, part 1
1 exam session
  • June/July 2026 · PDF page 2

Module 4

Define Scope and explain the different scopes in python. Also explain the lookup rules with examples.

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

View question scan & diagramsOriginal question scan, part 1
1 exam session
  • June/July 2026 · PDF page 2

Describe the three import statement variants with suitable examples.

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

View question scan & diagramsOriginal question scan, part 1
1 exam session
  • June/July 2026 · PDF page 2

Develop a Python program to create your own module with one function and import it in another file.

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

View question scan & diagramsOriginal question scan, part 1
1 exam session
  • June/July 2026 · PDF page 2
Show 2 Backup Questions

Develop python code using user defined functions to generate a list of random month numbers out of 12 months with duplicity and without duplicity.

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

View question scan & diagramsOriginal question scan, part 1
1 exam session
  • June/July 2026 · PDF page 2

Explain mutable versus immutable data types. Also explain the concept of aliasing with example.

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

View question scan & diagramsOriginal question scan, part 1
1 exam session
  • June/July 2026 · PDF page 2

Module 5

Define Classes and Objects in python. Construct a class called rectangle and initialize it with height = 100, width = 200, starting point as (x = 0, y = 0) and write the method to display the center point coordinates of a rectangle.

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

View question scan & diagramsOriginal question scan, part 1
1 exam session
  • June/July 2026 · PDF page 2

Define Polymorphism with a suitable python program.

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

View question scan & diagramsOriginal question scan, part 1
1 exam session
  • June/July 2026 · PDF page 2

Describe deepcopy() and shallowcopy() with suitable code example.

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

View question scan & diagramsOriginal question scan, part 1
1 exam session
  • June/July 2026 · PDF page 2
Show 2 Backup Questions

Explain the concept of operator overloading in Python. With suitable code snippets, demonstrate how the + operator is overloaded for a user-defined MyTime class. Also explain how the * operator can be overloaded using bothmul_() and_rmul() methods in a Point class.

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

View question scan & diagramsOriginal question scan, part 1
1 exam session
  • June/July 2026 · PDF page 2

Explain the concept of sameness using is and == operator.

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

View question scan & diagramsOriginal question scan, part 1
1 exam session
  • June/July 2026 · PDF page 2