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

1 Answer

4 votes

Answer:

This code will no get executed properly.It will give keyerror Brianna.

Step-by-step 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.

User Poru
by
6.0k points