Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question no. 6: Complete the function, so that if you don't have a key return 999. [10 points) # Code goes here def get from(dictionary,
Question no. 6: Complete the function, so that if you don't have a key return 999. [10 points) # Code goes here def get from(dictionary, keys): values = ? #complete your code here return values #should return 999 if key doesn't exist print(getfrom(dictionary=d, keys='z')) Question no. 6: Complete the function, so that if you don't have a key return 999. (10 points) # Code goes here def getfrom(dictionary, keys): values = ? #complete your code here return values #should return 999 if key doesn't exist print(getfrom(dictionary=d, keys='z')) Question no. 7: Complete the function, so that if you don't have a key return 999 and add 999 to dictionary? (10 points) # Code goes here def get from(dictionary, keys): values = ? #complete your code here return values #should return 999 if key doesn't exist and should add to dictionary as well print(getfrom(dictionaryd, keysu'z')) # Now this shouldn't throw error as 'z' is now set to dictionary print(d['z'l)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started