Ask Question

What would be the result of the following code? ages = {'Aaron' : 6, 'Kelly' : 3, 'Abigail' : 1 } value = ages['Brianna']

+5
Answers (1)
  1. 23 May, 09:56
    0
    This code will no get executed properly. It will give keyerror Brianna.

    Explanation:

    In this dictionary we defined in the code the there is no key Brianna hence there is no corresponding value to Brianna. So assigning ages['Brianna] to value will obviously give error since there exits no key with this name. So the code will give error.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “What would be the result of the following code? ages = {'Aaron' : 6, 'Kelly' : 3, 'Abigail' : 1 } value = ages['Brianna'] ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers