# Dictionary iteration over values >> for value in my_dict.values() ... print(value) ... Kenneth, Treehouse, Oregon, 33, USA, Teacher
# Dictionary >>> my_dict = {'name': 'Kenneth', 'job': 'Teacher'}
# Keys >>> my_dict['job'] 'Teacher'
# Dictionaries as keys >>> name_dict = {'names': {'first': 'Kenneth', 'last': 'Love'}} >>> name_dict['names']['last'] 'Love'
# Create/Edit new keys >>> my_dict = {'name': 'Kenneth', 'job': 'Teacher'} >>> my_dict['age'] = 33 {'name': 'Kenneth', 'job': 'Teacher', 'age': 33}
# Updating Dictionaries >>> my_dict.update({'job': 'Teacher', 'state': 'Oregon', 'age': '33', 'name': 'Kenneth'}) >>> my_dict {'job': 'Teacher', 'state': 'Oregon', 'age': '33', 'name': 'Kenneth'}
# Tuples as keys >>> game_dict = {(2,2): True, (1,2): False} >>> game_dict[(1,2)] False
# Unpacking >>> my_string = "Hi! My name is {name} and I live in {state}" >>> my_dict = { 'name':' Kenneth', 'state': 'Oregon' } >>> my_string.format(**my_dict) 'Hi! My name is Kenneth and I live in Oregon'
# Dictionary iteration over keys >> for key in my_dict: ... print(key)
# Dictionary iteration over values >> for key in my_dict: ... print(my_dict[key])
# Dictionary iteration over values >> for value in my_dict.values() ... print(value) ... Kenneth, Treehouse, Oregon, 33, USA, Teacher
>>> my_tuple = (1,2,3)
>>> my_2nd_tuple = 1,2,3
>>> my_3rd_tuple = tuple( [1,2,3] ) (1,2,3)
# Immutable >>> my_3rd_tuple[1] = 5 TypeError!
>>> a, b = 1, 2
# Packing & Unpacking >>> c = (3,4) >>> d, e = c >>> f = d, e >> f == c True
# Swapping >>> a, b = b, a
# Enumerate a List using a Tuple >>> for index, letter in enumerate(my_alphabet_list): ... print('{}: {}'.format(index, letter))
# Enumerate a List using a packed Tuple >>> for step in enumerate(my_alphabet_list): ... print('{}: {}'.format(step[0], step[1]))
# Enumerate a List using unpacking a packed Tuple >>> for step in enumerate(my_alphabet_list): ... print('{}: {}'.format(*step))
# Dictionary Iteration >>> for key, value in my_dict.items() ... print('{}: {}'.format(key, value))