a = {'one':1, 'two':2, 'three': 3}
b = dict(one=1, two=2, three= 3)
c = dict(zip(['one', 'two', 'three'], [1, 2, 3]))
a == b == c


"""
Explanation: wk1.3
warm - up

Create a dictionary called numbers with the keys 'one', 'two', 'three', and associated values 1, 2, 3 three different ways.
End of explanation
"""


a['one'] 

"""
Explanation: Get the value from the dictionary for key 'one'.
End of explanation
"""


a['two'] = 'dos'
a

"""
Explanation: Update the value for key 'two' to 'dos'
End of explanation
"""


a['four'] = 4
a

"""
Explanation: Add a new key value pair for 'four'/4
End of explanation
"""


del a['one']
a

"""
Explanation: delete the key value pair 'one'/1
End of explanation
"""


for k in a.keys():
    print(k)
    
for k in a:
    print(k)

"""
Explanation: iterate over all the keys using a for loop
End of explanation
"""


for k in a:
    print(a[k])
    
print()

for val in a.values():
    print(val)
    
print()

for k, val in a.items():
    print(val)

"""
Explanation: iterate over all the values using a for loop
End of explanation
"""


for k, val in a.items():
    print((k, val))
    
print()

for k in a:
    print((k, a[k]))

print()

for elem in a.items():
    print(elem)

"""
Explanation: iterate over all the key/value pairs (as a tuple) with a for loop (two different ways)
End of explanation
"""


# Aliasing
a = {}
b = a
b['hi'] = 1
b

# Copy
a = {}
b = a.copy()
b['hi'] = 1
b

# Aliasing
a = []
b = a
b.append(1)
b

# copy
a = []
b = a[:]
b.append(1)
a

# copy
a = []
b = a.copy()
b.append(1)
a

# Immutable datastructures (ex. tuples) can't be updated so no way to alias.
a = ()
b = a
b = b + (1,)
a

"""
Explanation: Dictionary keys can be mutable (True/False?).
Dictionary values can be mutable (True/False?).
Dictionaries are an example of a homogeneous datatype (True/False?).
Looking up a value in a list is generally faster than looking up a value in a dictionary (True/False?).
Suppose I set dict2 = numbers. If I change dict2 will numbers stay the same? Why or why not?
End of explanation
"""


