<jupyter_start><jupyter_text>Tuple<jupyter_code>t = ('Norway', 4.5, 3)
t[0]
t[2]
len(t)
for item in t:
    print (item)
t + (3.3, 'hello')
t *3
my_tuple = ((1,2),('hello','world'),(3.5,4.6))
my_tuple
my_tuple[1][0]<jupyter_output><empty_output><jupyter_text>single element as tuple : need to use trailing ,<jupyter_code>single_tuple = (100,)
type(single_tuple_tuple)
empty_tuple = ()
type(empty_tuple)
p = 1,2,3,4,5
p<jupyter_output><empty_output><jupyter_text>function return as tuple min max<jupyter_code>def minmax(items):
    return min(items), max(items)
minmax([1,3,5,100,200])<jupyter_output><empty_output><jupyter_text>Tuple unpacking<jupyter_code>lower, upper = minmax([1,2,5,100,200,2,45])
lower
upper
(a,(b,(c,d))) = (1,(2,(3,4)))
a
b
c
d
a = 'jelly'
b = 'bean'
a,b = b,a
a
b
tuple([1,3,4,5,])
tuple('Hello World')<jupyter_output><empty_output><jupyter_text>checking item in tuple<jupyter_code>5 in (5,3,2,1)
4 in (3,2,1,5)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.19398340248962656, 'fraction_numerical': 0.06535269709543569, 'mean_word_length': 8.46078431372549, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '171903', 'license': 'MIT', 'n_tokens_mistral': 469, 'n_tokens_neox': 449, 'n_words': 77, 'path': '06.Core Python - Getting Started/07.Built-in Collections - Tuples.ipynb', 'repo_name': 'ptyadana/python-dojo', 'size': '964'}