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
TEA [102]
3 years ago
11

The groups_per_user function receives a dictionary, which contains group names with the list of users. Users can belong to multi

ple groups. Fill in the blanks to return a dictionary with the users as keys and a list of their groups as values.
def groups_per_user(group_dictionary):
user_groups = {}
# Go through group_dictionary
for ___:
# Now go through the users in the group
for ___: # Now add the group to the the list of
# groups for this user, creating the entry
# in the dictionary if necessary
return(user_groups)
print(groups_per_user({"local": ["admin", "userA"],
"public": ["admin", "userB"],
"administrator": ["admin"] }))
Computers and Technology
1 answer:
Akimi4 [234]3 years ago
3 0

The groups_per_user function receives a dictionary, which contains group names with the list of users.

Explanation:

The blanks to return a dictionary with the users as keys and a list of their groups as values is shown below :

def groups_per_user(group_dictionary):

   user_groups = {}

   # Go through group_dictionary

   for group,users in group_dictionary.items():

       # Now go through the users in the group

       for user in users:

       # Now add the group to the the list of

         # groups for this user, creating the entry

         # in the dictionary if necessary

         user_groups[user] = user_groups.get(user,[]) + [group]

   return(user_groups)

print(groups_per_user({"local": ["admin", "userA"],

       "public":  ["admin", "userB"],

       "administrator": ["admin"] }))

You might be interested in
Can some one please help The term career is usually applied to a what PLEASEEEEEEEEEEEE HEEEEELLLLLPPPPP MEEEEEE
Sati [7]

Answer:

Position that allows for professional growth and advancement

Explanation:

Career is referring to better pay than a job because it allows the person to grow professionally and that knowledge the person can show anywhere. For example, the teacher matches this term, because the teacher will always look forward to the advancement and things that would help others.

This kind of personal and professional growth is considering a journey because the person that is growing has to learn each day about different and helpful things.

7 0
3 years ago
Jamie has to enter the names, grades, and scores of a group of students into a worksheet. Which option will Jamie use to describ
inessss [21]

Answer:

B. Graphs

Explanation:

Graphs are used to put certain things into categories. In this case Jamie has to enter different categories such as names, grades and the scored of the students. C and D don't make sense for this problem since they aren't actually what he is looking for. A is plausible but he needs it into a worksheet and labels aren't worksheets they are just labels. So B would be your answer. Also I took the quiz this is the correct answer.

8 0
2 years ago
What is the best method for collecting information from a source?
hichkok12 [17]
I personally think that summarizing important points is the way to go!
6 0
3 years ago
To determine the type of power in use and to determine battery state or charge on a laptop, you ________.: course hero
Kryger [21]
<span> Hover the mouse over the power icon in the notifcation area</span>
3 0
3 years ago
Name the types of computer used in hospital for computer​
disa [49]

Answer: These are all the computers they use All.

All In One Computers.

Medical Grade Computers.

Medical Tablets.

Medical Box PCs.

Medical Box PCs.

Displays & Monitors.

Medical Grade Monitors.

5 0
3 years ago
Other questions:
  • Using the merge method of the Map interface, which statement correctly updates the salesTotalByDept map of type Map to update th
    7·1 answer
  • The purpose of a capacitor unit in a vacuum cleaner is to
    12·1 answer
  • Identify the mobile device deployment option that gives the user flexibility to select a device, but allows the company to contr
    5·1 answer
  • When you save a drawing using paint, it's automatically stored as a?
    15·1 answer
  • What are barcode and rfid tags ​
    11·2 answers
  • Which type of password would be considered secure
    13·2 answers
  • Create a program that includes a function called toUpperCamelCase that takes a string (consisting of lowercase words and spaces)
    9·1 answer
  • Assume that the array arr has been defined and initialized with the values {4, 2, 5, 3, 1}. What are the values in the array arr
    15·1 answer
  • To determine the average of a range of numbers, click the ____ in the formula bar, then click average.
    13·1 answer
  • Data types influence the following in the workflow: (Select all that apply)a. the color choices and layout decisions around comp
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!