Quiz Space

January 2024 term · Programming in Python · BSCS1002

Python Quiz 1: 25 February 2024, Set 1-3 (January 2024 term)

The IIT Madras BS Programming in Python (Python) Quiz 1 paper sat on 25 Feb 2024, in the January 2024 term, set 1-3: 12 questions for 36 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
12
Marks
36
Duration
120 min
MCQ
4
Numerical
8

Updated

Official paper: IIT M FOUNDATION AN4 EXAM QDF4 25 Feb 2024 · No negative marking.

Question 1

+4 marksOne correct option

Consider a program that accepts a word as input from the user and prints the number of vowels in it. You can assume that the input will be given in lower case.

Consider a program that accepts a word as input from the user and prints the number of vowels in it. You can assume that the input will be given in lower case.
Which of these two snippets is correct?

  1. A

    Only snippet-1 is correct

  2. B

    Only snippet-2 is correct

  3. C

    Both snippets 1 and 2 are correct

  4. D

    Both snippets 1 and 2 are incorrect

Show answer

Correct answer

  • C

    Both snippets 1 and 2 are correct

Question 2

+4 marksOne correct option
  1. A

    Only snippet-1 is correct

  2. B

    Only snippet-2 is correct

  3. C

    Both snippets 1 and 2 are correct

  4. D

    Both snippets 1 and 2 are incorrect

Show answer

Correct answer

  • A

    Only snippet-1 is correct

Question 3

+4 marksOne correct option

Which of the code snippets given below computes the minimum of three integers, not necessarily distinct from each other?

Which of the code snippets given below computes the minimum of three integers, not necessarily distinct from each other?

  1. A

    Only snippet-1 is correct

  2. B

    Only snippet-2 is correct

  3. C

    Both snippets 1 and 2 are correct

  4. D

    Both snippets 1 and 2 are incorrect

Show answer

Correct answer

  • D

    Both snippets 1 and 2 are incorrect

Question 4

+4 marksNumerical answer

What is the output of the following snippet of code? Enter an integer as your answer.

What is the output of the following snippet of code? Enter an integer as your answer.

Show answer

Correct answer: 54

Question 5

+4 marksNumerical answer
Show answer

Correct answer: 49721

Question 6

+4 marksNumerical answer
Show answer

Correct answer: 2301

Question 7

+4 marksNumerical answer

What is the output of the following snippet of code?

What is the output of the following snippet of code?

Show answer

Correct answer: 3

Question 8

+1 markNumerical answer

Based on the above data, answer the given subquestions.

What is the value of a , the first input entered by the user, if it is given that the user entered a positive integer?

Show answer

Correct answer: 5

Question 9

+1 markNumerical answer

Based on the above data, answer the given subquestions.

What is the value of b , the second input entered by the user, if it is given that the user entered a positive integer?

Show answer

Correct answer: 11

Question 10

+2 marksNumerical answer

What is the second line of the output? Enter an integer as your answer.

Show answer

Correct answer: 4

Question 11

+2 marksNumerical answer

What is the first line of the output?

Show answer

Correct answer: 8

Question 12

+2 marksOne correct option

What is the second line of the output?

  1. A

    1263.87

  2. B

    1263

  3. C

    1263.871

  4. D

    1263.8719

Show answer

Correct answer

  • A

    1263.87