uiz Space

January 2026 term · Programming in Python · BSCS1002

Programming in Python Quiz 1: 15 March 2026 (January 2026 term)

The IIT Madras BS Programming in Python (Python) Quiz 1 paper sat on 15 Mar 2026, in the January 2026 term: 32 questions for 104 marks in 120 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.

Questions
32
Marks
104
Duration
120 min
MCQ
14
MSQ
6
Written
12

Updated

Official paper: Programming in Python 15 Mar 26 · No negative marking.

Question 1

+3 marksOne correct option

Consider the following code:

What will be the output?

Consider the following code:
  1. A

    —

  2. B

    —

  3. C

    —

  4. D

    —

Show answer

Correct answer

  • B

    —

Question 2

+3 marksOne correct option

Consider the following code:

What will be the output?

Consider the following code:
  1. A

    —

  2. B

    —

  3. C

    —

  4. D

    —

Show answer

Correct answer

  • B

    —

Question 3

+3 marksOne correct option

Consider the following code:

What will be the output?

Consider the following code:
  1. A

    —

  2. B

    —

  3. C

    —

  4. D

    —

Show answer

Correct answer

  • B

    —

Question 4

+3 marksOne correct option

Consider the following code:

What will be the output?

Consider the following code:
  1. A

    —

  2. B

    —

  3. C

    —

  4. D

    —

Show answer

Correct answer

  • B

    —

Question 5

+3 marksOne correct option

Consider the following Python code:

What will be the output?

Consider the following Python code:
  1. A

    —

  2. B

    —

  3. C

    —

  4. D

    —

Show answer

Correct answer

  • D

    —

Question 6

+3 marksOne correct option

Consider the following Python code:

What will be the output?

Consider the following Python code:
  1. A

    —

  2. B

    —

  3. C

    —

  4. D

    —

Show answer

Correct answer

  • D

    —

Question 7

+4 marksOne correct option

Consider the following code:

What will be the output?

Consider the following code:
  1. A

    —

  2. B

    —

  3. C

    —

  4. D

    —

Show answer

Correct answer

  • B

    —

Question 8

+4 marksOne correct option

Consider the following code:

What will be the output?

Consider the following code:
  1. A

    —

  2. B

    —

  3. C

    —

  4. D

    —

Show answer

Correct answer

  • B

    —

Question 9

+4 marksOne or more correct options

Consider the following Python code:

Which of the following statements are true?

Consider the following Python code:

Select all that apply.

  1. A

    The final value of is

  2. B

    The character increases by

  3. C

    The letter increases the value of by and the character increases by

  4. D

    The letter increases the value of by and the character increases by

Show answer

Correct answers

  • A

    The final value of is

  • B

    The character increases by

  • D

    The letter increases the value of by and the character increases by

Question 10

+4 marksOne or more correct options

Consider the following Python code:

Which of the following statements are true?

Consider the following Python code:

Select all that apply.

  1. A

    The final value of is

  2. B

    The character increases by

  3. C

    The letter increases the value of by and the character increases by

  4. D

    The letter increases the value of by and the character increases by

Show answer

Correct answers

  • A

    The final value of is

  • B

    The character increases by

  • D

    The letter increases the value of by and the character increases by

Question 11

+4 marksOne or more correct options

Consider the following Python code:

Which of the following statements are true?

Consider the following Python code:

Select all that apply.

  1. A

    The output of the first statement is

  2. B

    The output of the second statement is

  3. C

    The default value of is used in the second function call

  4. D

    The function returns two values as a tuple

  5. E

    The output of the second statement is

Show answer

Correct answers

  • A

    The output of the first statement is

  • D

    The function returns two values as a tuple

  • E

    The output of the second statement is

Question 12

+4 marksOne or more correct options

Consider the following Python code:

Which of the following statements are true?

Consider the following Python code:

Select all that apply.

  1. A

    The output of the first statement is

  2. B

    The output of the second statement is

  3. C

    The default value of is used in the second function call

  4. D

    The function returns two values as a tuple

  5. E

    The output of the second statement is

Show answer

Correct answers

  • A

    The output of the first statement is

  • D

    The function returns two values as a tuple

  • E

    The output of the second statement is

Question 13

+4 marksWritten answer

What is the output of the following snippet of code?

What is the output of the following snippet of code?
Show answer

A written answer, not marked automatically.

Question 14

+4 marksWritten answer

What is the output of the following snippet of code?

What is the output of the following snippet of code?
Show answer

A written answer, not marked automatically.

Question 15

+4 marksWritten answer

Consider the following snippet of code. What will the output be?

Consider the following snippet of code. What will the output be?
Show answer

A written answer, not marked automatically.

Question 16

+4 marksWritten answer

Consider the following snippet of code. What will the output be?

Consider the following snippet of code. What will the output be?
Show answer

A written answer, not marked automatically.

Question 17

+4 marksWritten answer

What is the output of the following snippet of code? Note: :checks whether an object belongs to a given type or any of its subclasses.

What is the output of the following snippet of code? Note:  :checks whether an object belongs to a given type or any of
Show answer

A written answer, not marked automatically.

Question 18

+4 marksWritten answer

What is the output of the following snippet of code? Note: :checks whether an object belongs to a given type or any of its subclasses.

What is the output of the following snippet of code? Note:  :checks whether an object belongs to a given type or any of
Show answer

A written answer, not marked automatically.

Question 19

+3 marksWritten answer

What is the output of the following snippet of code?

What is the output of the following snippet of code?
Show answer

A written answer, not marked automatically.

Question 20

+3 marksWritten answer

What is the output of the following snippet of code?

What is the output of the following snippet of code?
Show answer

A written answer, not marked automatically.

Question 21

+4 marksOne correct option

Consider the following snippet of code and answer the sub-questions:

Consider the following snippet of code and answer the sub-questions:

What is the value of after executing the given code?

  1. A

    —

  2. B

    —

  3. C

    —

  4. D

    —

Show answer

Correct answer

  • B

    —

Question 22

+4 marksOne correct option

Consider the following snippet of code and answer the sub-questions:

Consider the following snippet of code and answer the sub-questions:

What is the value of after executing the given code?

  1. A

    —

  2. B

    —

  3. C

    —

  4. D

    —

Show answer

Correct answer

  • B

    —

Question 23

+3 marksOne correct option

Consider the following snippet of code and answer the sub-questions:

Consider the following snippet of code and answer the sub-questions:

In the given code, if we change the condition to instead of , what will be the value of ?

  1. A

    —

  2. B

    —

  3. C

    —

  4. D

    —

Show answer

Correct answer

  • A

    —

Question 24

+3 marksOne correct option

Consider the following snippet of code and answer the sub-questions:

Consider the following snippet of code and answer the sub-questions:

In the given code, if we change the condition to instead of , what will be the value of ?

  1. A

    —

  2. B

    —

  3. C

    —

  4. D

    —

Show answer

Correct answer

  • A

    —

Question 25

+4 marksOne correct option

Consider the following snippet of code and answer the sub-questions:

Consider the following snippet of code and answer the sub-questions:

What are the values of and after executing the given code?

  1. A

    —

  2. B

    —

  3. C

    —

  4. D

    —

Show answer

Correct answer

  • B

    —

Question 26

+4 marksOne correct option

Consider the following snippet of code and answer the sub-questions:

Consider the following snippet of code and answer the sub-questions:

What are the values of and after executing the given code?

  1. A

    —

  2. B

    —

  3. C

    —

  4. D

    —

Show answer

Correct answer

  • B

    —

Question 27

+3 marksOne or more correct options

Consider the following snippet of code and answer the sub-questions:

Consider the following snippet of code and answer the sub-questions:

Which of the following statements are true?

Select all that apply.

  1. A

    Both and are substrings of

  2. B

    The expression evaluates to

  3. C

    The comparison ignores uppercase and lowercase letters

  4. D

    The expression evaluates to

Show answer

Correct answers

  • A

    Both and are substrings of

  • D

    The expression evaluates to

Question 28

+3 marksOne or more correct options

Consider the following snippet of code and answer the sub-questions:

Consider the following snippet of code and answer the sub-questions:

Which of the following statements are true?

Select all that apply.

  1. A

    Both and are substrings of

  2. B

    The expression evaluates to

  3. C

    The comparison ignores uppercase and lowercase letters

  4. D

    The expression evaluates to

Show answer

Correct answers

  • A

    Both and are substrings of

  • D

    The expression evaluates to

Question 29

+1 markWritten answer

Consider the following snippet of code and answer the sub-questions:

Consider the following snippet of code and answer the sub-questions:
Show answer

A written answer, not marked automatically.

Question 30

+1 markWritten answer

Consider the following snippet of code and answer the sub-questions:

Consider the following snippet of code and answer the sub-questions:
Show answer

A written answer, not marked automatically.

Question 31

+1 markWritten answer

Consider the following snippet of code and answer the sub-questions:

Consider the following snippet of code and answer the sub-questions:
Show answer

A written answer, not marked automatically.

Question 32

+1 markWritten answer

Consider the following snippet of code and answer the sub-questions:

Consider the following snippet of code and answer the sub-questions:
Show answer

A written answer, not marked automatically.