tuple notes
tuple notes
• Long tuple:
• Nested tuple:
Creation of Tuple
tuple() function is used to create a tuple from other
sequences. See examples-
Tuple creation from string Tuple creation from list
• Membership operator:
• Working of membership operator “in” and “not in” is
same as in a list.
• Concatenation and Replication operators:
• + operator adds second tuple at the end of first tuple. *
operator repeats elements of tuple.
Accessing a Tuple
• Accessing Individual elements-
• Traversal of a Tuple –
for <item> in <tuple>:
#to process every element.
OUTPUT
Tuple Operations
• Tuple
joining
• Both the tuples should be there to
add with +.
• Tuple Replication-
Tuple Slicing
max( ) Function
min( ) Function
index( ) Function
tuple( ) Function
Thank you