Answer:
Following is given the code with all necessary description given as comments in it. I hope it will help you!
Explanation:
It would be autosum your welcome:)
Answer:
- def getData(a_dict, key_list):
- result = []
-
- for key in key_list:
- result.append(a_dict[key])
-
- return result
-
- result = getData( {"puffin": 5, "corgi": 2, "three": 3} , ["three", "corgi"])
- print(result)
Explanation:
Let's define a function <em>getData() </em>with two parameters,<em> a_dict </em>and <em>key_list</em> as required by the question (Line 1).
Since the function is to return a list of associated values of dictionaries, a new list,<em> result</em>, is declared and initialized with empty values (Line 2).
Next, use for-loop to traverse through every string in the input <em>key_list </em>(Line 4) and use the traversed key to address the value in the<em> a_dict </em>and add it to the <em>result</em> list (Line 5)
At last, return the <em>result </em>list as output (Line 7)
We can test the function using the test case from the question and we shall see the output as follows:
[3, 2]
Answer:
La ciencia y la tecnología han tenido un gran impacto en la sociedad y su impacto está creciendo. ... Al hacer la vida más fácil, la ciencia le ha dado al hombre la oportunidad de perseguir preocupaciones sociales como la ética, la estética, la educación y la justicia; crear culturas; y mejorar las condiciones humanas.
The data transmission speeds of token ring networks were 4Mbps and 16Mbps, implying that token frames were transmitted in the millions of times per second range.