Programming in Python Quiz 1: 5 June 2022 (May 2022 term)
The IIT Madras BS Programming in Python (Python) Quiz 1 paper sat on 5 Jun 2022, in the May 2022 term: 13 questions for 50 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.
- 13
- 50
- 120 min
- 4
- 5
- 4
Show answer
Correct answer
Question 2
Show answer
Correct answer
Question 3
Code-1 is correct and code-2 is incorrect
Code-1 is incorrect and code-2 is correct
Both codes are correct
Both are incorrect
Show answer
Correct answer
Both are incorrect
Question 4
What is the output of the following snippet of code?
Show answer
Correct answer
Question 5
If line-6 is executed, then line-8 will not be executed.
If line-11 is executed, then lines 14 to 17 will not be executed.
If line-8 is executed, the interpreter will directly jump to line-19 without even reading the remaining lines.
The interpreter evaluates at least three if conditions for any combinations of inputs.
Show answer
Correct answers
If line-6 is executed, then line-8 will not be executed.
If line-11 is executed, then lines 14 to 17 will not be executed.
The interpreter evaluates at least three if conditions for any combinations of inputs.
Question 6
agaiN
giVEN
goodSHOW
erasE
Show answer
Correct answers
agaiN
erasE
Question 7
Show answer
Correct answers
Question 8
kind
kindkind
kindkindkind
kindkindkindkind
kindkindkindkindkind
kindkindkindkindkindkind
Show answer
Correct answers
kind
kindkind
kindkindkind
kindkindkindkindkindkind
Question 9
Show answer
Correct answers
Question 10
Show answer
Correct answer: 55
Question 11
Show answer
Correct answer: 24
Question 12
The following code always accepts a positive even integer as input.
Show answer
Correct answer: 2
Question 13
What is the output of the following snippet of code?
Show answer
Correct answer: 56
