Question: Write a function that has three parameters: the dictionary name key name value name Write a function that checks if the given value name matches
Write a function that has three parameters:
the dictionary name
key name
value name
Write a function that checks if the given value name matches the value of the key name in the supplied dictionary. If it does, your function should return True
and if not it should return False.
Use the function header:
def doesitMatchdictionary keyName, valueName:
For example:
doesitMatch "color": "Blue", "item": "chair", "year": 'color' 'red'
should return False because the value for the key "color" in the dictionary is "Blue" not "red"
doesitMatch "color": "blue", "item": "chair", "year": 'color' 'blue'
should return True because the value of the key "color" in the dictionary is "blue"
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
