You are on page 1of 1

Practical No.

7: Write Python program to perform following operations on


Tuples: Create Tuple, Access Tuple, Update Tuple, Delete Tuple

1. Create a tuple and find the minimum and maximum number from it.
t= (100,200,-25,300,400)
print "Max value element : ", max(t)
print "Max value element : ", min(t)

2. Write a Python program to find the repeated items of a tuple.


t = (1, 2, 3, 4, 2, 7, 8, 8, 3,6,9,6);
print("Repeated elements in given array: ");
for i in range(0, len(t)):
for j in range(i+1, len(t)):
if(t[i] == t[j]):
print(t[j]);

3. Write a Python program to print the number in words for Eg.


1234=>One Two Three Four
num = input ("Enter a Number = ")
dic = { "0" : "Zero" , "1":"One " , "2" : "Two" , "3" : "Three" , "4" : "Four" , "5" :
"Five" , "6" : "Six" , "7" : "Seven" , "8" : "Eight" , "9" : "Nine"}
for i in num:
print(dic[i],end=" ")

You might also like