1my_tuple = ('a','p','p','l','e',)
2
3# len() : get the number of elements in a tuple
4print(len(my_tuple))
5
6# count(x) : Return the number of items that is equal to x
7print(my_tuple.count('p'))
8
9# index(x) : Return index of first item that is equal to x
10print(my_tuple.index('l'))
11
12# repetition
13my_tuple = ('a', 'b') * 5
14print(my_tuple)
15
16# concatenation
17my_tuple = (1,2,3) + (4,5,6)
18print(my_tuple)
19
20# convert list to a tuple and vice versa
21my_list = ['a', 'b', 'c', 'd']
22list_to_tuple = tuple(my_list)
23print(list_to_tuple)
24
25tuple_to_list = list(list_to_tuple)
26print(tuple_to_list)
27
28# convert string to tuple
29string_to_tuple = tuple('Hello')
30print(string_to_tuple)
31
1count(x) : Returns the number of times 'x' occurs in a tuple
2index(x) : Searches the tuple for 'x' and returns the position of where it was first found