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

21. What is the result of: my_tuple = (1, 2, 3); print(my_tuple[-1])

  • 1
  • 2
  • 3
  • Error
Show Answer Report

22. How do you count occurrences of an element in a tuple?

  • my_tuple.occurrences(2)
  • my_tuple.count(2)
  • my_tuple.find_all(2)
  • count(my_tuple, 2)
Show Answer Report

23. What is tuple comparison?

  • Comparing memory addresses
  • Element-by-element comparison
  • Comparing only lengths
  • Tuples cannot be compared
Show Answer Report

24. What will be the output of: tuple1 = (1, 2); tuple2 = (1, 2); print(tuple1 == tuple2)

  • True
  • False
  • Error
  • None
Show Answer Report

25. Why are tuples used as keys in dictionaries while lists are not?

  • Tuples are faster
  • Tuples are immutable and hashable
  • Lists take more memory
  • Tuples have better methods
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test