#!/usr/bin/python # A directory example dict = {'fName': 'Edward', 'lName': 'Bigos', 'Office': 617, 'Phone': '413-755-4544'} try: print("dict['fName'] dict['lName']: ", dict['fName']," ", dict['lName']) print ("dict['Office']: ", dict['Office']) print ("dict['Phone']: ", dict['Phone']) # print ("dict['Mobile']: ", dict['Mobile']) except KeyError: print("Invalid key selected.") print("Sorry, there is no key with that name in the directory.") print("\n")