xxxxxxxxxx
# define a dictionary
my_dict = {'a': 1, 'b': 2, 'c': 3}
# get the values of the dictionary
values = my_dict.values()
# print the values
print(values) # dict_values([1, 2, 3])
# get a list of the values
values = list(my_dict.values())
# print the values
print(values) # [1, 2, 3]
xxxxxxxxxx
dict = {'color': 'blue', 'shape': 'square', 'perimeter':20}
dict.get('shape') #returns square
#You can also set a return value in case key doesn't exist (default is None)
dict.get('volume', 'The key was not found') #returns 'The key was not found'