uiz Space

May 2026 term · Programming in Python · BSCS1002

Programming in Python End Term: 13 September 2026, Set 1 (May 2026 term)

The IIT Madras BS Programming in Python (Python) End Term paper sat on 13 Sept 2026, in the May 2026 term, set 1: 17 questions for 48 marks in 180 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.

Questions
17
Marks
48
Duration
180 min
MCQ
10
MSQ
2
Numerical
5

Updated

Official paper: Programming in Python 13 Sep 26 (Session 2) · No negative marking.

Question 1

+3 marksOne correct option

Consider the following code snippet.

What will be the output?

  1. A

    1 1

  2. B

    2 2

  3. C

    1 2

  4. D

    Error

Show answer

Correct answer

  • B

    2 2

Question 2

+3 marksOne correct option

Hari runs a yoga class and grades students into levels based on a flexibility score out of 100.

Which of the following snippets correctly compute and print the level after accepting the score as input? Assume the input entered will always be an integer in the range [0,100]. Snippet-1

Snippet-2

Snippet-3

  1. A

    Snippet-1 and Snippet-2 are correct, Snippet-3 is incorrect.

  2. B

    Only Snippet-1 is correct.

  3. C

    Snippet-1 and Snippet-3 are correct, Snippet-2 is incorrect.

  4. D

    All three snippets are correct.

Show answer

Correct answer

  • A

    Snippet-1 and Snippet-2 are correct, Snippet-3 is incorrect.

Question 3

+3 marksOne correct option

Consider the following code.

What is the output?

  1. A

    5 B KeyError

  2. B

    4 C E

  3. C

    2 C E

  4. D

    2 A D

Show answer

Correct answer

  • C

    2 C E

Question 4

+3 marksOne correct option

Govinda runs a fruit stall. Each day he sells fruit and restocks.

What is the output?

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • A

Question 5

+3 marksOne correct option

Consider the following program.

Which of the following statements correctly explains why the printed value is obtained?

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • A

Question 6

+3 marksOne correct option

Consider the following code snippet.

What is printed?

  1. A

    2 3

  2. B

    3 3

  3. C

    2 2

  4. D

    Error

Show answer

Correct answer

  • A

    2 3

Question 7

+3 marksOne or more correct options

Madhava maintains a ledger file for the shop.

Select all that apply.

  1. A
  2. B
  3. C
  4. D

    There are 4 lines in the output.

  5. E

    The output contains empty lines.

Show answer

Correct answers

  • A
  • B
  • C
  • D

    There are 4 lines in the output.

Question 8

+3 marksOne or more correct options

You are reviewing a connection-manager script for a load balancer.

Which of the following statements are true at the end of the script?

Select all that apply.

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answers

  • B
  • C

Question 9

+3 marksNumerical answer

Consider the following code snippet.

What is the output produced by the above code?

Show answer

Correct answer: 12

Question 10

+3 marksNumerical answer

Consider the following code.

What is the output of the above code?

Show answer

Correct answer: 20

Question 11

+3 marksNumerical answer

In order to protect secrecy, OTPs are often encrypted across the network. Caesar cipher is one such encryption technique.
Consider the following code.

What is the output of the above code?

Show answer

Correct answer: 2075

Question 12

+3 marksNumerical answer

How many characters does the file contain after complete execution?

Show answer

Correct answer: 14

Question 13

+3 marksNumerical answer

Consider the following code.

What is the output of the above code?

Show answer

Correct answer: 9

Question 14

+2 marksOne correct option

Example:

The following program processes the file.

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • B

Question 15

+2 marksOne correct option

Example:

The following program processes the file.

  1. A

    Replace with

    (A figure from the original paper is missing from the source site.)

  2. B

    Replace with

    (A figure from the original paper is missing from the source site.)

  3. C

    (A figure from the original paper is missing from the source site.)

  4. D

    Replace with

    (A figure from the original paper is missing from the source site.)

Show answer

Correct answer

  • B

    Replace with

    (A figure from the original paper is missing from the source site.)

Question 16

+2 marksOne correct option

Allowed : No Group Comprehension Questions : No Question Pattern Type : NonMatrix A university stores information about students as a list of dictionaries. A student is allotted an elective only if: the student's CGPA is at least 8, and• the requested course has remaining seats.•

Based on the above data, answer the given subquestions

Which ONE of the following statements must be true after execution?

  1. A

    Every student having CGPA ≥ 8 receives a course.

  2. B
  3. C
  4. D

    Every course requested by at least one eligible student has zero remaining capacity.

Show answer

Correct answer

  • B

Question 17

+2 marksOne correct option

Allowed : No Group Comprehension Questions : No Question Pattern Type : NonMatrix A university stores information about students as a list of dictionaries. A student is allotted an elective only if: the student's CGPA is at least 8, and• the requested course has remaining seats.•

Based on the above data, answer the given subquestions

Suppose the order of students in the list is changed arbitrarily, while keeping every student's information unchanged. Which ONE of the following statements is correct?

  1. A
  2. B

    The set of allotted students is guaranteed to remain unchanged.

  3. C

    The number of allotted students is guaranteed to remain unchanged, but the students receiving a particular course may change.

  4. D
Show answer

Correct answer

  • C

    The number of allotted students is guaranteed to remain unchanged, but the students receiving a particular course may change.