Computational Thinking and Programming-I Quiz 12

πŸ“¦ Computational Thinking & Programming-I Quiz 12 β€” Tuples in Python (Class 11 CS)

Practice 20 CBSE Class 11 Computer Science (Code 083) MCQs on Python tuples β€” indexing, tuple operations (concatenation, repetition, membership, slicing), built-in functions/methods (len(), tuple(), count(), index(), sorted(), min(), max(), sum()), tuple assignment (unpacking), nested tuples, and suggested programs like finding the min/max/mean and counting frequency.

Every function and expression below has been verified by actually running it in Python β€” including fixes to two questions from the original quiz that were either incomplete or missing the correct option entirely. Tap any question to reveal the answer with a clear explanation.

πŸ“¦ Tuple BasicsπŸ”’ Indexingβž• Tuple Operations🧰 Built-in FunctionsπŸ”— Tuple AssignmentπŸͺ† Nested Tuples⭐ Suggested Programsβš–οΈ Tuple vs List
Q1
πŸ“¦ Tuple Basics

What is a tuple in Python?

  1. A sequence of numbers only
  2. A sequence of characters only
  3. A mathematical equation
  4. An ordered, immutable collection of values
Show Answer & Explanation

βœ… Answer: (d) An ordered, immutable collection of values

A tuple is an ordered collection of values, written in round brackets like (1, 2, 3), and β€” unlike a list β€” it’s immutable, meaning it can’t be changed once created.

Q2
πŸ”’ Indexing

How can you access individual elements in a tuple?

  1. By using parentheses ()
  2. By using curly braces {}
  3. By using square brackets []
  4. By using angle brackets <>
Show Answer & Explanation

βœ… Answer: (c) By using square brackets []

Even though tuples are defined with round brackets, you still access their elements using square brackets β€” e.g. t[0] β€” exactly like lists and strings.

Q3
βž• Tuple Operations

Which of the following tuple operations combines two or more tuples together?

  1. Concatenation
  2. Repetition
  3. Membership
  4. Slicing
Show Answer & Explanation

βœ… Answer: (a) Concatenation

Concatenation (using +) joins two tuples into a single new tuple: (1,2) + (3,4) gives (1, 2, 3, 4).

Q4
βž• Tuple Operations

Which tuple operation repeats a tuple a certain number of times?

  1. Concatenation
  2. Repetition
  3. Membership
  4. Slicing
Show Answer & Explanation

βœ… Answer: (b) Repetition

Repetition (using *) repeats a tuple’s elements: (1,2) * 2 gives (1, 2, 1, 2).

Q5
🧰 Built-in Functions

Which built-in function is used to determine the length of a tuple?

  1. len()
  2. tuple()
  3. count()
  4. index()
Show Answer & Explanation

βœ… Answer: (a) len()

len() returns the number of elements in a tuple, just as it does for lists and strings.

Q6
🧰 Built-in Functions

Which built-in method is used to count the occurrences of an element in a tuple?

  1. len()
  2. tuple()
  3. count()
  4. index()
Show Answer & Explanation

βœ… Answer: (c) count()

count() tallies how many times a given value appears in the tuple.

Q7
🧰 Built-in Functions

Which built-in method is used to find the index of the first occurrence of an element in a tuple?

  1. len()
  2. tuple()
  3. count()
  4. index()
Show Answer & Explanation

βœ… Answer: (d) index()

index() returns the position of the first matching element, and raises a ValueError if the value isn’t found.

Q8
🧰 Built-in Functions

Which built-in method is used to create a tuple from another sequence?

  1. len()
  2. tuple()
  3. count()
  4. index()
Show Answer & Explanation

βœ… Answer: (b) tuple()

The tuple() constructor converts an iterable (like a list or string) into a tuple β€” e.g. tuple([1, 2, 3]) gives (1, 2, 3).

Q9
🧰 Built-in Functions

Which built-in function sorts the elements of a tuple in ascending order?

  1. sorted()
  2. sort()
  3. orderby()
  4. sum()
Show Answer & Explanation

βœ… Answer: (a) sorted()

sorted() works on a tuple and returns a new list of the sorted elements. Note: tuples don’t have a .sort() method at all β€” that only exists on mutable types like lists, since sorting in place would require changing the tuple.

Q10
🧰 Built-in Functions

Which built-in function finds the minimum value in a tuple of numbers?

  1. sorted()
  2. min()
  3. max()
  4. sum()
Show Answer & Explanation

βœ… Answer: (b) min()

min() scans the tuple and returns the smallest value.

Q11
🧰 Built-in Functions

Which built-in function finds the maximum value in a tuple of numbers?

  1. sorted()
  2. maximum()
  3. max()
  4. sum()
Show Answer & Explanation

βœ… Answer: (c) max()

max() scans the tuple and returns the largest value. (maximum() isn’t a real Python function.)

Q12
🧰 Built-in Functions

Which built-in function calculates the sum of the values in a tuple of numbers?

  1. sorted()
  2. total()
  3. add()
  4. sum()
Show Answer & Explanation

βœ… Answer: (d) sum()

sum() adds up every numeric value in the tuple and returns the total. (total() and add() aren’t real Python built-ins.)

Q13
πŸ”— Tuple Assignment

What is tuple assignment (also called tuple unpacking) in Python?

  1. Assigning individual values from a tuple to multiple variables at once, e.g. a, b, c = (1, 2, 3)
  2. Assigning any single tuple to any single variable
  3. Assigning an index position to a tuple
  4. Assigning a length value to a tuple
Show Answer & Explanation

βœ… Answer: (a) Assigning individual values from a tuple to multiple variables at once, e.g. a, b, c = (1, 2, 3)

Tuple assignment (unpacking) specifically means assigning each element of a tuple to its own variable in one line β€” e.g. a, b, c = (1, 2, 3) sets a=1, b=2, c=3. (This question is corrected from the original, whose answer β€” β€œassigning a tuple to a variable” β€” describes ordinary assignment that applies to any data type, not the specific unpacking behaviour that makes tuple assignment a distinct, named concept.)

Q14
πŸͺ† Nested Tuples

What is a nested tuple?

  1. A tuple with repeated values
  2. A tuple with mixed data types
  3. A tuple placed inside another tuple
  4. A tuple with no elements
Show Answer & Explanation

βœ… Answer: (c) A tuple placed inside another tuple

A nested tuple is a tuple that contains another tuple as one of its elements β€” e.g. ((1, 2), (3, 4)).

Q15
⭐ Suggested Programs

Which of the following correctly describes the suggested program for counting the frequency of elements in a tuple?

  1. Counting how many times each element appears, typically using count() in a loop
  2. Sorting the tuple’s elements in ascending order
  3. Reversing the order of the tuple’s elements
  4. Concatenating two different tuples together
Show Answer & Explanation

βœ… Answer: (a) Counting how many times each element appears, typically using count() in a loop

Frequency counting means determining how many times each distinct value shows up β€” commonly done by looping through the unique values and calling tuple.count(value) for each. (This question is corrected/completed from the original quiz, whose four answer options β€” minimum, maximum, mean, linear search β€” didn’t actually include β€œfrequency counting” at all, making the question unanswerable as originally written.)

Q16
βž• Tuple Operations

What is the result of the expression 3 in (1, 2, 3) in Python?

  1. True
  2. False
  3. 3
  4. Error
Show Answer & Explanation

βœ… Answer: (a) True

The membership operator in checks whether a value exists in the tuple β€” since 3 is present, this evaluates to True.

Q17
βž• Tuple Operations

What does the slice t[1:3] return for the tuple t = (10, 20, 30, 40, 50)?

  1. (10, 20)
  2. (20, 30)
  3. (20, 30, 40)
  4. (30, 40)
Show Answer & Explanation

βœ… Answer: (b) (20, 30)

Just like with lists, [1:3] takes elements from index 1 up to (but not including) index 3: (20, 30).

Q18
πŸ“¦ Tuple Basics

What happens when you try to run t = (1, 2, 3); t[0] = 10 in Python?

  1. The tuple updates to (10, 2, 3)
  2. Nothing happens, the tuple stays the same
  3. It raises a TypeError
  4. It automatically converts the tuple to a list first
Show Answer & Explanation

βœ… Answer: (c) It raises a TypeError

Since tuples are immutable, trying to assign a new value to an index raises a TypeError β€” 'tuple' object does not support item assignment. This is the defining difference from lists.

Q19
βš–οΈ Tuple vs List

What is the key difference between a tuple and a list in Python?

  1. Tuples use square brackets, lists use round brackets
  2. Tuples are immutable; lists are mutable
  3. Lists can only store numbers; tuples can store anything
  4. There is no real difference between them
Show Answer & Explanation

βœ… Answer: (b) Tuples are immutable; lists are mutable

The core distinction is mutability: a tuple cannot be changed after creation, while a list can have elements added, removed, or modified freely. (It’s actually the reverse of option (a) β€” tuples use round brackets (), lists use square brackets [], to define them.)

Q20
πŸͺ† Nested Tuples

For the nested tuple t = ((1, 2), (3, 4)), what does t[1][0] give?

  1. 1
  2. 2
  3. 3
  4. 4
Show Answer & Explanation

βœ… Answer: (c) 3

Nested indexing works left to right: t[1] gives (3, 4), and [0] of that gives 3.

Jitendra Singh
βœ” Verified Educator

Jitendra Singh

Founder of CBSEPython.in

I help CBSE Class 9–12 students learn Python, Information Technology, Artificial Intelligence and Computer Science through easy notes, quizzes, MCQs and sample papers.

Read More About Me β†’