Question: Part 1 . get _ keys ( ) Write a function definition with the following expectations: The function name is get _ keys and has
Part getkeys
Write a function definition with the following expectations:
The function name is getkeys and has a dictstr int parameter.
The function should return a liststr
The function should produce a list of all the keys in the input dictionary.
If the input dict is empty, it should return an empty list.
The function should not mutate modify the input dictionary.
Explicitly type variables, parameters, and return types.
Example usage:
from lessons.unzip import getkeys
test: dictstr intHello : "World" :
getkeystest
Hello 'World'
Part getvalues
Write a function definition with the following expectations:
The function name is getvalues and has a dictstr int parameter.
The function should return a list int
The function should produce a list of all the values in the input dictionary.
If the input dict is empty, it should return an empty list.
The function should not mutate modify the input dictionary.
Explicitly type variables, parameters, and return types.
Example usage:
from lessons.unzip import getvalues
test: intHello : "World" :
getvaluestest
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
