Tuples Questions and Answers

Take Exam

Python Programming - Tuples Questions with Answers help learners understand immutable data storage. These Python Tuples Questions are valuable for TCS, Capgemini, and SSC exams, testing sequence data type knowledge

Tuples

Showing 10 of 25 questions

1. Which of the following is the correct way to create a tuple in Python?

  • tuple = [1, 2, 3]
  • tuple = (1, 2, 3)
  • tuple = {1, 2, 3}
  • tuple = <1, 2, 3>
Show Answer Report

2. What is the key characteristic that distinguishes tuples from lists in Python?

  • Tuples can store only integers
  • Tuples are immutable
  • Tuples use square brackets
  • Tuples are faster for all operations
Show Answer Report

3. How do you access the second element in a tuple called my_tuple?

  • my_tuple(2)
  • my_tuple[1]
  • my_tuple[2]
  • my_tuple.get(1)
Show Answer Report

4. Which method is available for tuples in Python?

  • append()
  • remove()
  • count()
  • sort()
Show Answer Report

5. What will be the output of: tuple1 = (1, 2, 3); tuple2 = tuple1 + (4,); print(tuple2)

  • (1, 2, 3, 4)
  • (1, 2, 3)(4)
  • Error
  • (1, 2, 3, (4))
Show Answer Report

6. How do you create a tuple with only one element?

  • my_tuple = (5)
  • my_tuple = (5,)
  • my_tuple = [5]
  • my_tuple = tuple(5)
Show Answer Report

7. Which operation is NOT allowed on tuples?

  • Slicing
  • Indexing
  • del my_tuple[0]
  • Concatenation
Show Answer Report

8. What is the result of: my_tuple = (1, 2, 3); print(len(my_tuple))

  • 1
  • 2
  • 3
  • 6
Show Answer Report

9. How can you convert a list to a tuple?

  • tuple = list.to_tuple()
  • tuple = (list)
  • tuple = tuple(list)
  • tuple = convert(list)
Show Answer Report

10. What does tuple unpacking allow you to do?

  • Add elements to a tuple
  • Remove elements from a tuple
  • Assign tuple elements to variables
  • Change tuple values
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test