Tuples: Immutable nature, tuple unpacking

  1. Write a Python program to create a tuple of student names and display all elements ?
  2. Write a Python program to display the first and last elements of a tuple using indexing ?
  3. Write a Python program to find the length of a tuple ?
  4. Write a Python program to count the occurrences of an element in a tuple ?
  5. Write a Python program to find the index position of an element in a tuple ?
  6. Write a Python program to check whether an element exists in a tuple ?
  7. Write a Python program to display all tuple elements using a loop ?
  8. Write a Python program to unpack a tuple containing student details into separate variables ?

  9. Write a Python program to swap two numbers using tuple unpacking ?
  10. Write a Python program to find the maximum and minimum values in a tuple ?
  11. Write a Python program to calculate the sum of all elements in a tuple ?
  12. Write a Python program to create a tuple from a list and display both ?
  13. Write a Python program to extract the first three elements of a tuple using slicing ?
  14. Write a Python program to reverse a tuple using slicing ?
  15. Write a Python program to demonstrate tuple immutability by attempting to modify an element ?
  16. Write a Python program to find duplicate elements in a tuple ?
  17. Write a Python program to unpack a tuple containing employee details and calculate annual salary ?
  18. Write a Python program to create a tuple of squares using a generator expression ?
Previous Topic Lists: Creation, indexing, slicing, methods (append(), pop(), sort()), intro to list comprehension Next Topic Dictionaries: Key-value structure, methods (get(), items(), etc.), Practice exercises combining functions, loops, and collections.