<jupyter_start><jupyter_text>tuple<jupyter_code>t1 = ()
type(t1)
t1 = tuple()
type(t1)
t1 = (1, 2, 3)
t1
t1 = 1, 2, 3
type(t1)
t1 = (1,)
type(t1)
t2 = (1, 2.0, 'three', [4, 5], (6, 7))
t2
t2[3][0] = 100
t2
(2, 3) * 2
t3 = ((1,2),)
type(t3[0][0])
del t2
t2 = (1, 2.0, 'three', [4, 5], (6, 7))
t2[-2:-1]
t1 = (1, 2, 3)
t2 + t1
t2
t1 = t2 + t1
t1
t1 = t1 * 2
t1
t1.count(5)
t1.count('g')
22 not in t1
l1 = [1, 2, 'hi']
t4 = tuple(l1)
t4<jupyter_output><empty_output><jupyter_text>set<jupyter_code>s1 = set()
type(s1)
s1 = {1, 2, 3, 4, 4, 4, 4, 'hi'}
s1
s2 = {1, 2, 3, 4, 4, (1, 2, 3), 4, 'hi'}
s2
l3 = [4, 3, 2, 1]
s3 = set(l3)
s3
s1.add('hey')
s1
s1.update([9, 8, 'bye'])
s1
s1.discard('bye')
s1
s1.discard('bye')
s1
s1.remove('hi')
s1
s1.remove('hi')
s1
s4 = deepcopy(s1)
s4.clear()
s4
s5 = {1, 2, 3}
s6 = {2, 3, 4, 5}
s5 | s6
s5 & s6
s5.union(s6)
s5.intersection(s6)
s5 - s6
s5.difference(s6)
s5 ^ s6
s5.symmetric_difference(s6)<jupyter_output><empty_output><jupyter_text>dictionary<jupyter_code>d1 = {}
type(d1)
d1 = dict()
type(d1)
d1 = {1:'one', 2:2.0, 'ke':'megh', ('kelid', 'key'):['value', 'meghdar']}
d1
d1[2]
d1[('kelid', 'key')]
d2 = dict( [('hi', 'salam'), ('hey', 'dorood')] )
d2
d2[0]
d2.get(0)
d2
d2.get('hi')
d3 = {}
d3[98149000] = 'ali alizadeh'
d3['98149099'] = 'fatemeh'
d3['98149088'] = 'zahra'
d3['98149077'] = 'sadegh'
d3
d3[98149000] = 'ali'
d3
d3.pop('98149099')
d3
d3.popitem()
d3
del d3[98149000]
d3
d3.clear()
d3
keys = ['a', '<KEY>']
d4 = dict.fromkeys(keys)
d4
val = ['alphabet', 'letter']
d5 = dict.fromkeys(keys, val)
d5
marks = {'Physics':67, 'Maths':87}
marks.items()
marks.keys()
marks.values()
marks
marks.setdefault('Maths')
marks
marks.setdefault('calc 1')
marks
marks.setdefault('db', 95)
marks
d6 = {1: 'one', 2:'two'}


marks.update(d6)

marks
marks.update(key = ['meghdar', 'val'])
marks
d7 = {'1': 'two'}
marks.update(d7)

marks<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.24973656480505796, 'fraction_numerical': 0.13962065331928344, 'mean_word_length': 4.772036474164134, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '70976', 'license': 'MIT', 'n_tokens_mistral': 1152, 'n_tokens_neox': 1058, 'n_words': 238, 'path': 'Recitation class/session4.ipynb', 'repo_name': 'VRU-CE/Information_Retrieval-4002', 'size': '1904'}