Indian Institute of Technology Madras
BS Degree Programme · Examination & Study Paper
Programming in Python
Conditionals (if-elif-else)
Examination Instructions & Guidelines
- Solve on notebook/paper first before checking solutions.
- MCQ: Exactly 1 option is correct. Negative marking applies.
- MSQ: One or more options correct. Select all to score.
- Scientific calculator allowed for all calculations.
- Official answer key is sealed at the end of this sheet.
Quiz 1 · 26 Oct 2025 (AN)Quiz 1
Useful Reference Data for this Paper
Useful Information
NAT → integer
For all NAT questions in this exam, the answer will always be an integer and not a float value. If the answer to a question is 18, then just enter that value. Do not enter 18.0
Q1MSQ3 Marks·Choose all correct optionsConsider the below code. if x: print('x') else: if y: if z: print('z') print('y') else: print('none') Select the possible output(s) of the given code, assuming any possible values for _x , _y , and _z .
- Ax
- Bz y
- Cx y
- Dnone
- Ex z
- Fy
End Term · 31 Aug 2025 (FN)End Term
- Q2MCQ3 Marks·Choose one option
Consider the following Python code: def evaluate_score(score): if score >= 90: if score == 100: print("Perfect Score") else: print("Excellent") elif score >= 60: if score >= 80: print("Very Good") else: print("Good") else: if score >= 40: if score % 2 == 0: print("Needs Improvement") else: print("Barely Passed") else: print("Fail") Which of the following inputs will produce the output _(Needs Improvement) ?
- A42
- B47
- C39
- D60
- Q3MCQ3 Marks·Choose one option
What will be the output of the following code snippet? data = [(4, 7), (5, 8), (6, 6), (9, 3)] total = 0 for a, b in data: if a % 2 == 0: if a < b: total += (b - a) elif a == b: total += a + b else: total += (a * b) % 4 else: if b % 2 == 0: total += b else: total -= a print(total)
- A30
- B14
- C16
- D6
End Term · 13 Apr 2025 (FN)End Term
- Q4MCQ3 Marks·Choose one option

- A

- B

- C

- D

- A
- Q5MSQ3 Marks·Choose all correct options

- A

- B

- C

- D

- A
End Term · 13 Apr 2025 (AN)End Term
- Q6MCQ3 Marks·Choose one option

- AOnly Snippet-1 is correct
- BOnly Snippet-2 is correct
- CBoth Snippet-1 and Snippet-2 are correct
- DBoth Snippet-1 and Snippet-2 are incorrect
- Q7MSQ3 Marks·Choose all correct options

- A

- B

- C

- D

- A
End Term · 22 Dec 2024 (FN)End Term
- Q8MCQ3 Marks·Choose one option

- A

- B

- C

- D

- A
End Term · 22 Dec 2024 (AN)End Term
- Q9MCQ3 Marks·Choose one option

- A

- B

- C

- D

- A