Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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