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
What is a scientific inquiry?
nlexa [21]
Scientific inquiry<span> refers to the diverse ways in which </span>scientists<span> study the natural world and propose explanations based on the evidence derived from their work.</span>
8 0
3 years ago
Consider the following statement, which is intended to create an ArrayList named a to store only elements of type Thing. Assume
bogdanovich [222]

Answer:

B: new ArrayList()

Explanation:

When dealing with Java syntax you always need to initialize an ArrayList object with its constructor. From the options listed the only correct option would be B: new ArrayList(). This would correctly initialize the ArrayList object but is not necessarily the recommended way of doing this. The truly recommended way would be the following

ArrayList<Thing> a = new ArrayList<Thing>()

7 0
3 years ago
One way to align and organize your table of contents is by using _______, which are dotted lines that precede your typed informa
bekas [8.4K]
They are dot leaders......
8 0
4 years ago
Jolie builds a model of a maglev train. She uses disc magnets to levitate the train. A disc magnet has its north and south poles
DIA [1.3K]
<span> I think it is B. Flat, so that the north pole of the magnets on the train point up and the north poles of the magnets on the track point down</span>
5 0
3 years ago
Read 2 more answers
The cell tower’s base transmission station is connected to a mobile ____ station.
geniusboy [140]

The cell tower’s base transmission station is connected to a mobile switching station.

<h3>What is a switching station?</h3>

A switching station is known to be a kind of a substation that is known to be without transformers and it is one that often operate  only based or at a single voltage level.

Note that Switching stations are known to be often used as collector and they also acts as a distribution stations.

Hence,  The cell tower’s base transmission station is connected to a mobile switching station.

Learn more about transmission station from

brainly.com/question/1312500

#SPJ1

8 0
2 years ago
Other questions:
  • A document repository is down when you attempt to access it. which isa principle is being violated?
    13·1 answer
  • How can i add card reader to pc answers?
    9·1 answer
  • Which of the following is not a job title associated with a career in visual and audio technology? master control operator produ
    9·1 answer
  • How to find i with superposition method
    8·1 answer
  • Rachel wants to make sure that she uses effective communication skills at work. Which of the following is an example of somethin
    6·2 answers
  • True or false? risk assessment should cover personnel, as well as technical support such as firewalls, secure operating systems
    13·1 answer
  • Here's a thought: Why does your Brainly ranking keep going down?
    6·2 answers
  • The "instance" relationship shows that something is an object of a ____.
    5·1 answer
  • List three tacos there are several from the opening page of the help and support center.
    5·1 answer
  • Does the wireless signal between the cell phones require matter to travel from one phone to another?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!