Consider the following dictionary: phonebook = { ‘Chris’ : ‘…
Consider the following dictionary: phonebook = { ‘Chris’ : ‘555-1111’, ‘Katie’ : ‘555-2222’, ‘Joanne’ : ‘555-3333’} If I try to execute following code, then it will generate KeyError exception. print( phonebook.get(‘Kathryn’, ‘Entry not found’ )
Read Details