Skip to content

Latest commit

 

History

History
27 lines (21 loc) · 670 Bytes

File metadata and controls

27 lines (21 loc) · 670 Bytes

Do Now 6.01

In your Console

Type the following code

my_dictionary = {
'cat': 'a domestic feline',
'dog': 'a domestic canine',
'chair': 'furniture piece for sitting',
'car': 'automobile'
}
print(my_dictionary)
print(my_dictionary['dog'])
print(my_dictionary.get('dog'))
print('cat' in my_dictionary)
print('monkey' in my_dictionary)

In your Notebook

Respond to the following

  1. Write down what was printed out. What type is my_dictionary?
  2. Add a line of code that will print the definition of 'chair', then run the code again.
  3. Write down what happens if you use my_dictionary['kittens']. What do you think that error means?