Question 1
Useful Data has been mentioned above.
This data attachment is just for a reference & not for an evaluation.

The IIT Madras BS Computational Thinking (Computational Thinking (CT)) Quiz 2 paper sat on 12 Apr 2026, in the January 2026 term: 14 questions for 52 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.
Useful Data has been mentioned above.
This data attachment is just for a reference & not for an evaluation.
Correct answer
Useful Data has been mentioned above.
What will be the value of outList at the end of execution of the given pseudocode?
—
—
—
—
Correct answer
—
The following pseudocode is executed using the "Words" dataset and explode(X) returns the list of letters in the word X. For example explode("apple") will return ['a', 'p', 'p', 'l', 'e']. What will cnt represent at the end of the execution? Note: isVowel(c) returns True if c is a vowel, False otherwise. isConsonant(c) returns True if c is a consonant, False otherwise.
Number of words with at least one vowel followed immediately by another vowel.
Number of words with at least one consonant followed immediately by a vowel.
Number of words with at least one vowel followed immediately by a consonant.
Number of words where the first letter is a vowel and the last is a consonant.
Correct answer
Number of words with at least one vowel followed immediately by a consonant.
The following pseudocode is executed using the "Scores" dataset. What will the values of A and B represent at the end of the execution?
A = Cities where students score the highest marks in Mathematics B = The highest marks in Mathematics
A = Number of cities where students score the highest marks in Mathematics B = The highest marks in Mathematics
A = Number of cities where students score the lowest marks in Mathematics B = The lowest marks in Mathematics
A = Always more than one B = The highest marks in Mathematics
Correct answer
A = Number of cities where students score the lowest marks in Mathematics B = The lowest marks in Mathematics
Use the procedure doSomething given below.
The following pseudocode is executed using the Words dataset and the procedure doSomething mentioned above. What will sList store at the end of the execution?
List of words from the "Words" dataset.
List of unique words from the "Words" dataset.
List of lists of words of each sentence from the "Words" dataset.
List of lists of unique words of each sentence from the "Words" dataset
Correct answer
List of lists of unique words of each sentence from the "Words" dataset
The following pseudocode is executed on the "Shopping Bills" dataset. What will Val represent at the end of the execution?
Number of customers whose total spending is greater than the average bill value.
Number of bills that are strictly greater than the average bill value.
Total amount spent by customers who spent more than the average bill value.
Number of customers whose single highest bill is greater than the average bill value.
Correct answer
Number of customers whose total spending is greater than the average bill value.
We have a dictionary Registration where the keys are student names and the values are lists of courses they have registered for. We want to create a new dictionary CourseRoll where the keys are course names and the values are lists of students registered for each course. For example, if Registration is:
Identify the correct implementation(s).




Correct answers


Two players play a game with dice. The results are stored in dieRolls, a list of pairs where each pair represents a roll: is Player 1's roll and is Player 2's roll. A player gets 1 point if their roll is higher than the other's. If both roll the same, no one gets a point. The procedure getWinner should return 1 if Player 1 wins, 2 if Player 2 wins, and 0 for a tie. Which of the following procedure(s) is/are correct?




Correct answers


Let SortedL be a list of integers sorted in ascending order. The procedure deleteVal(SortedL, X) is supposed to delete first instance of X from SortedL (if it exists) while maintaining the sorted order. Identify the correct implementation(s). Note: Assume member function checks existence and remove function removes first occurrence in-place




Correct answers



Let Z be a row in the Words table such that Z.Word = "reluctant". What will be the value of alphaDict['t'] at the end of the execution of the following pseudocode?
A written answer, not marked automatically.
The following procedure is executed on dictionary D: D = { 'A': 10, 'B': 25, 'C': 30, 'D': 40, 'E': 18 }
What is the final value of val?
A written answer, not marked automatically.
The following pseudocode is executed using the "Olympics" dataset. TeamDict is a dictionary accumulating player names for each country.
Answer the given subquestions.
What does the variable count represent at the end of execution?
Total number of rows processed.
Total number of unique country-player pairs.
Total number of unique countries.
Total number of medals won.
Correct answer
Total number of unique country-player pairs.
The following pseudocode is executed using the "Olympics" dataset. TeamDict is a dictionary accumulating player names for each country.
Answer the given subquestions.
If we modify the code to remove this membership check: and always append the player instead, what would TeamDict[country] contain?
A list of unique players for that country.
A list of all players for that country, including duplicates for multiple medals/years.
A single player name (the last one read).
The count of players for that country.
Correct answer
A list of all players for that country, including duplicates for multiple medals/years.
The following pseudocode is executed using the "Olympics" dataset. TeamDict is a dictionary accumulating player names for each country.
Answer the given subquestions.
A written answer, not marked automatically.