# Tuple manipulation
tuple1 = (10,50,20,40,30)
print("Original tuple : ", tuple1)
print("Displaying elements 10 and 50 ")
print(tuple1[0])
print(tuple1[1])
print("length of tuple = ", len(tuple1))
print("minimum element in tuple = ", min(tuple1))
print("sum of tuple elements = ", sum(tuple1))
ntimes = int(input("Enter number of times : "))
print(tuple1*ntimes)
tuple1 = (10,50,20,40,30)
print("Original tuple : ", tuple1)
print("Displaying elements 10 and 50 ")
print(tuple1[0])
print(tuple1[1])
print("length of tuple = ", len(tuple1))
print("minimum element in tuple = ", min(tuple1))
print("sum of tuple elements = ", sum(tuple1))
ntimes = int(input("Enter number of times : "))
print(tuple1*ntimes)
No comments:
Post a Comment
Don't be a silent reader...
Leave your comments...
Anu