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
Name the six parts of the product development life cycle.
Nuetrik [128]

Answer:

Development, Introduction, Growth, Maturity and Decline.

Explanation:

5 0
3 years ago
Read 2 more answers
What is astronaut favourite key on keyboard? ​
Dennis_Churaev [7]

Answer:

The space bar is an astronauts favorite key

5 0
3 years ago
Read 2 more answers
Brief deacription of how hard drives have evolved
Zepler [3.9K]

Answer:

The first HDD was created by IBM in 1956 and was the size of a refrigerator. The total storage capacity was 5 MB and only two heads were used to read the disks. The 1970s offered a hard disk drive in much smaller shells with the ability to store roughly 60 MB.

Please Mark Brainliest If This Helped!

4 0
2 years ago
To comply with ATC instructions for altitude changes of more than 1,000 feet, what rate of climb or descent should be used?
jasenka [17]

Answer:

B

Explanation:

5 0
3 years ago
____ are model building techniques where computers examine many potential solutions to a problem, iteratively modifying various
gregori [183]

Answer:

E. Genetic algorithms

Explanation:

In Computer science, Genetic algorithms are model building techniques where computers examine many potential solutions to a problem, iteratively modifying various mathematical models, and comparing the mutated models to search for a best alternative.

6 0
3 years ago
Other questions:
  • Which wildcat character will return a single character when using the find dialog box
    14·1 answer
  • Which of the following refers to a feature of wikis that allows the restoring of earlier work in the event of a posting error, i
    9·1 answer
  • Write a shell script called SpellOutDate that prints the detail of the current date in separate lines. For example if the curren
    13·1 answer
  • Identify any eight new programming languages and classify them based on their functionality.
    14·2 answers
  • Using the employment websites, search for part-time jobs that relate to the career fields you are interested in pursuing or to y
    12·2 answers
  • To show the navigation pane if it is hidden, click the ____ button
    12·2 answers
  • Create a vector of structures experiments that stores information on subjects used in an experiment. Each struct has four fields
    12·1 answer
  • Suggest names for a coding club
    10·1 answer
  • What is a banner grab?
    12·1 answer
  • which of the following statements about the evolving relationship between traditional newspaper operations and blogging is true?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!