Quiz Space

Programming in Python · Quiz 1 · 25 Feb 2024 · January 2024 term · Set 1

Question 1: Consider a program that accepts a word as input from the …

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 1 of 12 in the IIT Madras BS Programming in Python (Python) Quiz 1 paper sat on 25 Feb 2024, in the January 2024 term (IIT M FOUNDATION AN4 EXAM QDF4 25 Feb 2024). It carries 4 marks.

More questions from this paper

  1. Q2Figure question
  2. Q3Which of the code snippets given below computes the minimum of three integers, not necessarily distinct from each other…
  3. Q4What is the output of the following snippet of code? Enter an integer as your answer. What is the output of the followi…
  4. Q5Figure question
  5. Q6Figure question
  6. Q7What is the output of the following snippet of code? What is the output of the following snippet of code?
  7. Q8What is the value of a , the first input entered by the user, if it is given that the user entered a positive integer?
  8. Q9What is the value of b , the second input entered by the user, if it is given that the user entered a positive integer?
  9. Q10What is the second line of the output? Enter an integer as your answer.
  10. Q11What is the first line of the output?
  11. Q12What is the second line of the output?