0% found this document useful (0 votes)
2 views1 page

Python Assignment 5

The document outlines a series of practice questions related to tuples in Python. Each question involves user input and various operations on tuples, such as printing, filtering, and manipulating data. The exercises aim to enhance understanding of tuple functionalities and methods.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Python Assignment 5

The document outlines a series of practice questions related to tuples in Python. Each question involves user input and various operations on tuples, such as printing, filtering, and manipulating data. The exercises aim to enhance understanding of tuple functionalities and methods.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

ASSIGNMENT- V

Sl No Practice Question

1. Accept n numbers from the user and create a tuple. Print the tuple.
2. Ask the user for a tuple of strings, then print all strings that start and end with the same
letter.
3. Accept a tuple from the user and print its length and all elements at even index positions.
4. Take space-separated integers as input, convert to a tuple, and print the maximum and
minimum values.
5. Input student names and marks as tuples (name, mark), then print all names with marks
greater than 90.
6. Accept a tuple from the user and count how many times each unique value appears.
7. Get a tuple of strings from user and print those containing the word "Python".
8. Ask the user to input a tuple of numbers and print their sum.
9. Input a tuple of numbers, check if a given number exists in the tuple, and print its index if
found.
10. Accept a tuple of numbers and print all elements in reverse order.
11. Take a tuple as input and display its middle element(s) (for odd/even length).
12. Input a tuple and print a new tuple containing only unique elements (no duplicates).
13. Accept two tuples from user and concatenate them, then print the new tuple.
14. Take a tuple and print all possible slices (start, end) as tuples (use for loop to show all
slices).
15. Input a tuple and a value to search. If found, print how many times it occurs; otherwise,
print "Not found".

You might also like