Question 1
NAT → integer For all NAT questions in this exam, the answer will always be an integer and not a float value.
Instructions has been mentioned above.
This Instructions is just for a reference & not for an evaluation.

The IIT Madras BS Programming in Python (Python) Quiz 1 paper sat on 19 Jul 2026, in the May 2026 term: 17 questions for 53 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.
NAT → integer For all NAT questions in this exam, the answer will always be an integer and not a float value.
Instructions has been mentioned above.
This Instructions is just for a reference & not for an evaluation.
Correct answer
Instructions has been mentioned above.
What is the output of the following code?
—
—
—
—
Correct answer
—
What is the output of the following code?
—
—
—
—
Correct answer
—
Which of the following statements is TRUE regarding the code below?
and both become
changes the original list
becomes while becomes
returns a new sorted list
Correct answer
becomes while becomes
Consider the following code.
What will be printed?
—
—
—
—
Correct answer
—
Consider the following code. Select all expressions that evaluate to .
—
—
—
—
Correct answers
—
—
Consider the following Python code.
Which of the following statements will run without giving an error?
—
—
—
—
Correct answers
—
—
—
What is the output of the following code?
A written answer, not marked automatically.
What is the output of the following code?
A written answer, not marked automatically.
What is the output of the following code?
A written answer, not marked automatically.
What is the output of the following code?
A written answer, not marked automatically.
Note: isinstance(val, datatype) returns True if val is of object of type 'datatype' and False, otherwise. Based on the above data, answer the given subquestions.
What is the value of ?
—
—
—
—
Correct answer
—
Note: isinstance(val, datatype) returns True if val is of object of type 'datatype' and False, otherwise. Based on the above data, answer the given subquestions.
Suppose the following condition inside the transform() function: is replaced with For the given input which of the following statements will become TRUE?
The final output becomes:
becomes
integer becomes
integer becomes
Correct answers
The final output becomes:
integer becomes
Based on the above data, answer the given subquestions.
What is the value of ?
—
—
—
—
Correct answer
—
Based on the above data, answer the given subquestions.
How many times is the condition evaluated?
A written answer, not marked automatically.
Note: isinstance(val, datatype) returns True if val is of object of type 'datatype' and False, otherwise. Based on the above data, answer the given subquestions.
A written answer, not marked automatically.
Based on the above data, answer the given subquestions.
A written answer, not marked automatically.