- What is a tuple in Python?
- How do you create an empty tuple?
- How does a tuple differ from a list?
- Are tuples mutable or immutable?
- Can you change elements in a tuple after creation?
- How do you create a single-element tuple?
- How do you access elements in a tuple?
- What is tuple packing?
- What is tuple unpacking?
- Can tuples contain mutable objects like lists?
- How do you concatenate two tuples?
- How do you repeat a tuple multiple times?
- Can you use tuples as dictionary keys? Why?
- What methods are available for tuples?
- How do you find the length of a tuple?
- How do you find the index of an element in a tuple?
- How do you count occurrences of an element in a tuple?
- Can you sort a tuple?
- What are named tuples in Python?
- What are the performance benefits of using tuples over lists?
- Write a program to unpack a tuple into four different variables.
- Write a function that accepts a list of numbers and returns a tuple containing the sum and average.
- Create a program that converts a tuple of strings to a single string.
- Given a list of tuples
[('Alice', 88), ('Bob', 95), ('Charlie', 88)], sort it by score (descending) and then by name (ascending). - Write a program to find all duplicate elements in a tuple.
- Create a tuple containing a list and demonstrate how to add a new element to the list within the tuple.
- Write a function to reverse a tuple without converting it to a list.
- Given two tuples, write a program to find common elements between them.
- Write a program to convert a number into a tuple of its individual digits.
- Create a named tuple to represent a
Pointwithx,y, andzcoordinates.