uiz Space

January 2026 term · Programming in Python · BSCS1002

Programming in Python End Term: 10 May 2026, Set 3 (January 2026 term)

The IIT Madras BS Programming in Python (Python) End Term paper sat on 10 May 2026, in the January 2026 term, set 3: 20 questions for 52 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
20
Marks
52
Duration
180 min
MCQ
10
MSQ
3
Written
7

Updated

Official paper: Programming In Python 06 May 26 · No negative marking.

Question 1

+3 marksOne correct option

Consider the following Python functions:

Given that mystery(8) == 4, what should replace the missing line?

Consider the following Python functions:
  1. A

    —

  2. B

    —

  3. C

    —

  4. D

    —

Show answer

Correct answer

  • B

    —

Question 2

+3 marksOne correct option

Consider the following code:

What is the output?

Consider the following code:
  1. A

    —

  2. B

    —

  3. C

    —

  4. D

    —

Show answer

Correct answer

  • A

    —

Question 3

+3 marksOne correct option

Consider the following Python function.

Which of the following inputs will produce the output 'b'?

Consider the following Python function.
  1. A

    —

  2. B

    —

  3. C

    —

  4. D

    —

Show answer

Correct answer

  • D

    —

Question 4

+3 marksOne correct option

What does the following code compute?

What does the following code compute?
  1. A

    85

  2. B

    105

  3. C

    91

  4. D

    36

Show answer

Correct answer

  • C

    91

Question 5

+3 marksOne correct option

Consider the snippets: Code-1

Code-2

Code-3

Which statement is correct?

Consider the snippets:  Code-1
Consider the snippets:  Code-1
Consider the snippets:  Code-1
  1. A

    Only Code-1 throws an error

  2. B

    Only Code-2 throws an error

  3. C

    Only Code-3 throws an error

  4. D

    None throw an error

Show answer

Correct answer

  • C

    Only Code-3 throws an error

Question 6

+3 marksOne correct option

What is the output of the following snippet of code?

What is the output of the following snippet of code?
  1. A
    Figure from the original question paper
  2. B
    Figure from the original question paper
  3. C
    Figure from the original question paper
  4. D
    Figure from the original question paper
Show answer

Correct answer

  • B
    Figure from the original question paper

Question 7

+3 marksOne or more correct options

What is the output?

What is the output?

Select all that apply.

  1. A

    The output contains

  2. B

    The output contains

  3. C

    p == 5

  4. D

    q == "Z"

  5. E

    p == "F"

  6. F

    q == "F"

  7. G

    The finally block executes only when an exception occurs

Show answer

Correct answers

  • B

    The output contains

  • E

    p == "F"

  • F

    q == "F"

Question 8

+3 marksOne or more correct options

is a list of tuples . Select all correct snippets that produce a list of names scoring strictly above 80, sorted by score descending.

Select all that apply.

  1. A
    Figure from the original question paper
  2. B
    Figure from the original question paper
  3. C
    Figure from the original question paper
  4. D
    Figure from the original question paper
Show answer

Correct answers

  • A
    Figure from the original question paper
  • B
    Figure from the original question paper

Question 9

+3 marksOne or more correct options

Consider the following snippet of code:

Select all that apply. Note • If a value is passed to , it reads that many number of characters from the current position of the file pointer. • The method moves the position of the file pointer to the given number of chars after the start of the file.

Consider the following snippet of code:

Select all that apply.

  1. A

    The first line of the output is .

  2. B

    The second line of the output is .

  3. C

    The second line of the output is .

  4. D

    There are 5 lines in the output.

  5. E

    The output contains empty lines.

Show answer

Correct answers

  • A

    The first line of the output is .

  • C

    The second line of the output is .

  • D

    There are 5 lines in the output.

Question 10

+3 marksWritten answer

Consider the following Python code snippet:

What is the output of the program?

Consider the following Python code snippet:
Show answer

A written answer, not marked automatically.

Question 11

+3 marksWritten answer

What is printed?

What is printed?
Show answer

A written answer, not marked automatically.

Question 12

+3 marksWritten answer

Fill in the blank with the missing expression so that the following conditions hold:

Fill in the blank with the missing expression so that the following conditions hold:
Show answer

A written answer, not marked automatically.

Question 13

+3 marksWritten answer

What is the output?

What is the output?
Show answer

A written answer, not marked automatically.

Question 14

+3 marksWritten answer

What is the output? Note : The function divmod(a, b) gives two values: (quotient : x // 10 , remainder : x % 10) for example: divmod(27, 10) gives (2, 7)

What is the output? Note : The function divmod(a, b) gives two values: (quotient : x // 10 , remainder : x % 10) for exa
Show answer

A written answer, not marked automatically.

Question 15

+2 marksOne correct option

Based on the above data, answer the given subquestions.

Based on the above data, answer the given subquestions.

What is printed by ?

  1. A

    4

  2. B

    No output

  3. C

    7

  4. D

    8

Show answer

Correct answer

  • B

    No output

Question 16

+2 marksOne correct option

Based on the above data, answer the given subquestions.

Based on the above data, answer the given subquestions.

What is printed as the output?

  1. A

    —

  2. B

    —

  3. C

    —

  4. D

    —

Show answer

Correct answer

  • C

    —

Question 17

+2 marksOne correct option

Based on the above data, answer the given subquestions.

Based on the above data, answer the given subquestions.

What is the value of ?

  1. A

    1

  2. B

    2

  3. C

    3

  4. D

    8

Show answer

Correct answer

  • B

    2

Question 18

+2 marksOne correct option

Based on the above data, answer the given subquestions.

Based on the above data, answer the given subquestions.

What is the value of ?

  1. A

    8

  2. B

    10

  3. C

    11

  4. D

    12

Show answer

Correct answer

  • B

    10

Question 19

+1 markWritten answer

Based on the above data, answer the given subquestions.

Based on the above data, answer the given subquestions.
Show answer

A written answer, not marked automatically.

Question 20

+1 markWritten answer

Based on the above data, answer the given subquestions.

Based on the above data, answer the given subquestions.
Show answer

A written answer, not marked automatically.