uiz Space

May 2026 term · Programming in Python · BSCS1002

Programming in Python End Term: 13 September 2026, Set S2 (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 S2: 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
7
MSQ
3
Numerical
7

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 does the code snippet print?

  1. A

    True -4 True 1

  2. B

    False -2 False 0

  3. C

    True -2 False 0

  4. D

    True 0 True 0

Show answer

Correct answer

  • C

    True -2 False 0

Question 2

+3 marksOne correct option

Consider the following code snippet.

What is the output?

  1. A

    4

  2. B

    10

  3. C

    16

  4. D

    100

Show answer

Correct answer

  • B

    10

Question 3

+3 marksOne correct option
  1. A
  2. B
  3. C

    It moves all multiples of 3 to the left and all other elements to the right (a partition), without changing the relative order of the non-multiples themselves.

  4. D
Show answer

Correct answer

  • B

Question 4

+3 marksOne correct option

Consider the following code snippet.

What will be the output?

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

Correct answer

  • C

Question 5

+3 marksOne correct option

What is the output of the above code?

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

Correct answer

  • C

Question 6

+3 marksOne correct option

Consider the following class used at the school fruit stall to track volunteer hours.

  1. A

    True, 1.25

  2. B

    True, 7.00

  3. C

    False, 7.00

  4. D

    False, 1.25

Show answer

Correct answer

  • B

    True, 7.00

Question 7

+3 marksOne or more correct options

Select all that apply.

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

Correct answers

  • A
  • B

Question 8

+3 marksOne or more correct options

Consider the following code snippet.

Select all correct statements.

Select all that apply.

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

Correct answers

  • B
  • D

Question 9

+3 marksOne or more correct options

Consider the following snippet.

Select all that apply.

Select all that apply.

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

Correct answers

  • A
  • C
  • D

Question 10

+3 marksNumerical answer

Consider the following code snippet.

What is the output of the above code?

Show answer

Correct answer: 5

Question 11

+3 marksNumerical answer

At Hari's yoga class, a running total is maintained while processing attendance codes.

What is the output of the above code?

Show answer

Correct answer: 21

Question 12

+3 marksNumerical answer

Consider the following code snippet.

Show answer

Correct answer: 7

Question 13

+3 marksNumerical answer

Consider the following code snippet.

Enter the sum of all the values present in the dictionary.

Show answer

Correct answer: 10

Question 14

+3 marksNumerical answer

In Madhava's shop, each item is stored in its own tray. Each tray can have a maximum of 40 items. Madhava stores the inventory as a dictionary, where the key is the item name and the value is a list containing the quantity of that item in each tray.
When Madhava counts the inventory, an item contributes to the total only if its overall quantity is at least 80. Otherwise, the item is added to a reload list.
Consider the following code.

What is the output of the above code?

Show answer

Correct answer: 181

Question 15

+2 marksOne correct option

Based on the above data, answer the given subquestions

What does the given code print?

  1. A

    Ahmed 2755

  2. B

    Vishaka 2755

  3. C

    Harry 2353

  4. D
Show answer

Correct answer

  • B

    Vishaka 2755

Question 16

+2 marksNumerical answer

Consider the following code snippet:

Based on the above data, answer the given subquestions

Show answer

Correct answer: 2

Question 17

+2 marksNumerical answer

Consider the following code snippet:

Based on the above data, answer the given subquestions

What is the value of the second line of output?

Show answer

Correct answer: 90