flora_to_color = { 'spruce': 'green', 'apple': 'red', 'shamrock': 'green', 'banana': 'yellow', 'potato': 'brown', 'eggplant': 'purple' } size = len( flora_to_color ) # the number of mappings print ( size ) flora_to_color[ 'lemon' ] = 'yellow' # dicts can have duplicate values but not keys size = len( flora_to_color ) print ( size ) print( flora_to_color ) c = flora_to_color.get( 'apple' ) print( c ) d = flora_to_color.get( 'Apple' ) # this is not in our dict, so will return None if printed print( d ) keys = flora_to_color.keys() # a list of the keys in the dict # cannot have repetitions print( keys ) values = flora_to_color.values() # a list of the values in the dict. # this list can have repetitions print( values ) c = flora_to_color['apple'] print( c ) #d = flora_to_color['Apple'] # wants to find a key, will not accept None #print( d ) # A test to determine if an object is in our dictionary reply = input( "Enter produce: " ) p = reply.strip() if ( p in flora_to_color ): # looks for keys in the dict # you can search for a value by using dict.values() c = flora_to_color.get( p ) print( c ) else: print( "What is a", p + "?" )