Question: Part 1 . get _ keys ( ) Write a function definition with the following expectations: The function name is get _ keys and has

Part 1. get_keys()
Write a function definition with the following expectations:
The function name is get_keys and has a dict[str, int] parameter.
The function should return a list[str]
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 get_keys
>>>test: dict[str, int]={"Hello" : 1, "World" : 2}
get_keys(test)
['Hello', 'World']
Part 2. get_values()
Write a function definition with the following expectations:
The function name is get_values and has a dict[str, 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 get_values
test: , int]={"Hello" : 1, "World" : 2}
>> get_values(test)
1,2
 Part 1. get_keys() Write a function definition with the following expectations:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!