You are on page 1of 1

UNIT-II: Tuples

Exercises for Observation:

1. Write a program to input ‘n’ no.of customer names and store it in tuple and display all customer
names on the output screen.

2. Write a program to input ‘n’ numbers and separate the tuple in the following manner.

Example

T=(10,20,30,40,50,60)

T1 =(10,30,50)

T2=(20,40,60)

3. Write a Python program to get the 4th element from the beginning and 4th element from last of the
tuple.

4. Define user defined function and pass two arguments are one tuple and element which are read from
the user and return True if element exists in a tuple otherwise return False.

Exercises for Record:

1. Write a program to input ‘n’ numbers and separate the tuple in the following manner.

Example

T=(10,20,30,40,50,60)

T1 =(10,30,50)

T2=(20,40,60)

2. Define user defined function and pass two arguments are one tuple and element which are read from
the user and return True if element exists in a tuple otherwise return False.

You might also like