<jupyter_start><jupyter_text>Tuple ItemsTuple items are ordered, unchangeable, and allow duplicate values.<jupyter_code>mytuple = ("python", "java", "SQL")
mytuple = ("python", "java", "SQL")
print(mytuple)<jupyter_output>('python', 'java', 'SQL')<jupyter_text>UnchangeableTuples are unchangeable, meaning that we cannot change, add or remove items after the tuple has been created.<jupyter_code>thistuple = ("python", "sql", "R")
print(thistuple[1])<jupyter_output><empty_output><jupyter_text>Access Tuple Items<jupyter_code>thistuple = ("apple", "banana", "cherry")
print(thistuple[1])
thistuple = ("apple", "banana", "cherry")
print(thistuple[-1])<jupyter_output><empty_output><jupyter_text>Python - Update TuplesOnce a tuple is created, you cannot change its values. Tuples are unchangeable, or immutable as it also is called.<jupyter_code>x = ("apple", "banana", "cherry")
y = list(x)
y[1] = "kiwi"
x = tuple(y)

print(x)

thistuple = ("apple", "banana", "cherry")
y = list(thistuple)
y.append("orange")
thistuple = tuple(y)
fruits = ("apple", "banana", "cherry")

(green, yellow, red) = fruits

print(green)
print(yellow)
print(red)
thistuple = ("apple", "banana", "cherry")
for x in thistuple:
  print(x)
tuple1 = ("a", "b" , "c")
tuple2 = (1, 2, 3)

tuple3 = tuple1 + tuple2
print(tuple3)<jupyter_output><empty_output><jupyter_text>Python SetsA set is a collection which is unordered, unchangeable*, and unindexed.<jupyter_code>thisset = {"apple", "banana", "cherry"}
print(thisset)

thisset = {"apple", "banana", "cherry", "apple"}

print(thisset)
thisset = {"apple", "banana", "cherry"}

for x in thisset:
  print(x)
thisset = {"apple", "banana", "cherry"}

print("banana" in thisset)
thisset = {"apple", "banana", "cherry"}

thisset.add("orange")

print(thisset)

thisset = {"apple", "banana", "cherry"}
tropical = {"pineapple", "mango", "papaya"}

thisset.update(tropical)

print(thisset)
thisset = {"apple", "banana", "cherry"}

thisset.remove("banana")

print(thisset)

thisset = {"apple", "banana", "cherry"}

for x in thisset:
  print(x)
set1 = {"a", "b" , "c"}
set2 = {1, 2, 3}

set3 = set1.union(set2)
print(set3)
set1 = {"a", "b" , "c"}
set2 = {1, 2, 3}

set1.update(set2)
print(set1)<jupyter_output>{'b', 'c', 'a', 1, 2, 3}<jupyter_text>Python DictionariesA dictionary is a collection which is ordered*, changeable and do not allow duplicates.ChangeableDictionaries are changeable, meaning that we can change, add or remove items after the dictionary has been created.<jupyter_code>thisdict = {
  "brand": "Ford",
  "model": "Mustang",
  "year": 1964
}
thisdict = {
  "brand": "Ford",
  "model": "Mustang",
  "year": 1964
}
print(thisdict)
thisdict = {
  "brand": "Ford",
  "model": "Mustang",
  "year": 1964
}
print(thisdict["brand"])

x = thisdict.get("model")
x
x = thisdict.keys()
car = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}

x = car.keys()

print(x) #before the change

car["color"] = "white"

print(x) #after the change
thisdict = {
  "brand": "Ford",
  "model": "Mustang",
  "year": 1964
}
thisdict["year"] = 2018

thisdict = {
  "brand": "Ford",
  "model": "Mustang",
  "year": 1964
}
thisdict["color"] = "red"
print(thisdict)

thisdict = {
  "brand": "Ford",
  "model": "Mustang",
  "year": 1964
}
thisdict.pop("model")
print(thisdict)

for x in thisdict:
  print(x)

thisdict = {
  "brand": "Ford",
  "model": "Mustang",
  "year": 1964
}
mydict = thisdict.copy()
print(mydict)
thisdict = {
  "brand": "Ford",
  "model": "Mustang",
  "year": 1964
}
mydict = dict(thisdict)
print(mydict)
myfamily = {
  "child1" : {
    "name" : "Emil",
    "year" : 2004
  },
  "child2" : {
    "name" : "Tobias",
    "year" : 2007
  },
  "child3" : {
    "name" : "Linus",
    "year" : 2011
  }
}

child1 = {
  "name" : "Emil",
  "year" : 2004
}
child2 = {
  "name" : "Tobias",
  "year" : 2007
}
child3 = {
  "name" : "Linus",
  "year" : 2011
}

myfamily = {
  "child1" : child1,
  "child2" : child2,
  "child3" : child3
}<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.19316754584275309, 'fraction_numerical': 0.02738005526249686, 'mean_word_length': 5.051671732522796, 'pattern_counts': {'":': 27, '<': 23, '<?xml version=': 0, '>': 23, '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': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '602792', 'license': 'CC0-1.0', 'n_tokens_mistral': 1684, 'n_tokens_neox': 1592, 'n_words': 389, 'path': '8_Python Set Tuples Dictionary/8_Set, Tuples, Dictionary Part_1.ipynb', 'repo_name': 'vivekkpatil7/Go-With-Python', 'size': '3981'}