answer.
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]
1 year 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]1 year 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
CAPTCHAs can be used as a form of signature to create a valid contract in e-commerce. True False
Len [333]
Thank you for posting your question here at brainly. I hope the answer will help you. Feel free to ask more questions.
The statement "CAPTCHAs can be used as a form of signature to create a valid contract in e-commerce. " is true. It is <span>a program or system intended to distinguish human from machine input, typically as a way of thwarting spam and automated extraction of data from websites.</span>
4 0
1 year ago
Read 2 more answers
Assume that name has been declared suitably for storing names (like "Misha", "Emily" and "Sofia") Write some code that reads a v
dlinn [17]

Answer:

void main(){

string name;

cout<<"Enter Name";

cin>>name;

cout<<"Greetings   " ;

cout<<name;

}

Explanation:

in main function we declared a variable called "name" .using cin we are reading the value into name  and we are printing that name using  cout.

3 0
1 year ago
Write a loop that reads strings from standard input, where the string is either duck or goose. the loop terminates when goose is
Misha Larkins [42]
Have in mind that the following code is ofr C++ but I know that whatever the language you are using, you can use the same idea:

<span><iostream> 
using namespace std; 
int main() 
{ 
int count=0; 
string x; 
while(1) 
{ 
cout<<"Enter either goose or duck"; 
cin>>x; 
if ( x=="Goose") break; 
count++; 
} 

cout<<"Number of Ducks="<<count<<endl; 
return 0; 
}
</span>
Another one that is simplier but the language is python is:
counter = 0while True:  line = input()if line == 'duck':  counter += 1    elif line == 'goose':breakprint(counter)
4 0
2 years ago
Which of the following are true statements about digital certificates in Web browsers?I. Digital certificates are used to verify
vladimir2022 [97]

Answer:

I only

Explanation:

Digital certificate are virtual encrypted keys or password used by individuals or organization  as a means of establishing secure connections between servers and websites so as to  be able to authenticate that only the legitimate people are having access to the information.

6 0
1 year ago
Catherine wants to search online for fruit juices. She is fine with aerated or fresh fruit juices. Which Boolean operator will e
ZanzabumX [31]
<h2>Answer:</h2>

<u>She will use the </u><u>OR Boolean operator</u>

<h2>Explanation:</h2>

Boolean Operators are used to connect and define the relationship between your search terms. Doing searching in any electronic databases like Google search engine, we use Boolean operators to either narrow or broaden our searches. The three Boolean operators are AND, OR and NOT. Among these operators OR is used to add the items. Since Catherine is searching for aerated or fresh fruit juices so she needs both the results therefore she must use OR operator.


8 0
2 years ago
Read 2 more answers
Other questions:
  • What helps companies and organizations to target masses of people, provide 24/7 services, and deliver better marketing in a chea
    13·2 answers
  • Where is the Name Manager dialog box found?
    13·1 answer
  • In the game Beehive, you play the role of a worker bee who must watch over her hive. Your duties include (among others) directin
    12·2 answers
  • Write a static method, getBigWords, that gets a single String parameter and returns an array whose elements are the words in the
    15·1 answer
  • You have configured your firewall to authenticate a group of 100 users who are in your company. You set up the database of users
    14·1 answer
  • For his class project, Matt has to create an image in a color scheme that has shade or tint variations of the same hue. Which co
    7·1 answer
  • Which of the following has been a result of the increase in local organic farms?a decrease in farmers' markets
    10·2 answers
  • Exercise 3: Function Write a function named word_count that accepts a string as its parameter and returns the number of words in
    10·1 answer
  • What does the binary odometer show about representing large numbers​
    15·1 answer
  • The Boffo Balloon Company makes helium balloons. Large balloons cost $13.00 a dozen, medium-sized balloons cost $11.00 a dozen,
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!