Write a program to perform below operations on tuple: ● Create a tuple with different data types. ● Print tuple items. ● Convert tuple into a list. ● Remove data items from a list. ● Convert list into a tuple. ● Print tuple items.
tuple1 = (1,'Number',3.14,False)
print(tuple1)
tuple2 = list(tuple1)
tuple2.pop(3)
tuple1 = tuple(tuple2)
print(tuple1)
output:
(1, 'Number', 3.14, False)
(1, 'Number', 3.14)
Comments
Post a Comment