1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
diamong [38]
3 years ago
8

Define a function below, get_subset, which takes two arguments: a dictionary of strings (keys) to integers (values) and a list o

f strings. All of the strings in the list are keys to the dictionary. Complete the function such that it returns the subset of the dictionary defined by the keys in the list of strings. For example, with the dictionary {"puffin": 5, "corgi": 2, "three": 3} and the list ["three", "corgi"], your function should return {"corgi": 2, "three": 3}. Since dictionaries are unordered, you can add the keys to the new dictionary in any order.
Computers and Technology
1 answer:
frozen [14]3 years ago
3 0

Answer:

The following are the program in the Python Programming Language.

#define function

def get_subset(dic,lst):

   #declare dictionary type array

   res = {}

   #set the for loop

   for a in lst:

       #set the if conditional statement

       if a in dic:

           #assign the value of 'dic' in the 'res'

           res[a] = dic[a]

   #return the variable 'res'

   return res

Explanation:

<u>The following are description of the program</u>.

  • In the above program, define the function 'get_subset()' and pass two arguments in its parameter 'dic' and 'lst'.
  • Declare dictionary type variable 'res' then, set the for loop.
  • Then, set the if conditional statement that checks the elements of the variable 'a' in the variable 'dic' and assigns the value of 'dic' in the variable 'res'.
  • Finally, return the variable 'res'.
You might be interested in
Hope goes through the steps of sorting a list. The resulting list is shown below.
Dmitry [639]

Answer:

Click the Header Row option.

Explanation:

7 0
3 years ago
What font family is Times New Roman an what font family is Arial?
Alexxandr [17]

Answer:

Some Font Examples

Generic Font Family                 Examples of Font Names

Serif                    Times New Roman Georgia Garamond

Sans-serif                          Arial Verdana Helvetica

Monospace                     Courier New Lucida Console Monaco

Cursive                        Brush Script MT Lucida Handwriting

Explanation:

hope it help

4 0
3 years ago
Read 2 more answers
The computers in the administrative offices of the four schools throughout the district are networked to enable employees to acc
muminat
These computers in administrative offices or schools throughout the district that are networked to each other has the type of network most likely used by the workers is LAN network. Usually LAN networks are used in small offices or rooms.
3 0
4 years ago
Select the correct answer.
hammer [34]

Answer:

B :)

Explanation:

C and D could work, but B is the most logical.

Hope it helps! :)

If I'm right, I would really appreciate it if you could vote me as the Brainliest answer. Thank you!

7 0
3 years ago
Read 2 more answers
Two Technicians are discussing Tire Fitment information.
IRISSAK [1]

Only technician A is correct.

Technician A only

<u>Explanation:</u>

According to technician A, tire fitment information provides specific specs of the vehicle including the inflation pressure, OEM tire size, and lug nut tire sequences. The class of vehicles is divided into a category of vehicles and these categories are further specialized to form different models. Each model has its own specifications and their requirements differ from one another.

Hence the tire fitment of each vehicle should convey specific information about the model in concern. For instance, the optimum inflation pressure of a Royal En field will not be the same as that of Hero Splendour as both have a huge difference in their respective weight and size.

4 0
3 years ago
Other questions:
  • What’s of the following can be used to visually represent information similar to diagrams format painter Helens smart are a clip
    8·1 answer
  • An internet service provider has three different subscription packages for its customers.  Package A: For $9.95 per month 10 ho
    10·1 answer
  • What does a graphic organizer do
    6·1 answer
  • What is the only language a microprocessor can process directly but most programmers almost never write programs in this code? Q
    12·2 answers
  • If the user enters 26 what is output? _____________
    15·1 answer
  • Using computers in place of paper to design components, products, and processes is referred to as ______.
    11·1 answer
  • What is wrong with each of the following?
    6·1 answer
  • The idea that managers tend to communicate more with other managers who share similar beliefs and experiences is represented by
    8·1 answer
  • In modern web design, color, font, font size, and style should be declared using:
    5·1 answer
  • Can you help me with Computer issues graphic organizer?<br> Will give out brainly
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!