Ask a New Question
Search
Questions and answers by
Mikaeel Iqbal
Questions (2)
Given a users dict that maps usernames to email addresses, how would you get the email address for the user djs?
email_address =
13 answers
94 views
Given a users dict that maps usernames to email addresses, how would you get the email address for the user djs?
1 answer
108 views
Answers (6)
What data structure stores items in key/value pairs? def dict str list
Which of the following methods gets the keys from a dict and lets you use them like a list? dict.convert_to_list() dict.choices() dict.val() dict.keys()
What dict method lets you loop through both the key and the value of the dict in a for loop? dict.get() dict.values() dict.items() dict.keys()
How do we get a random key from a menu_items dict using the random module's choice() function? random_menu_item = choice(menu_items.keys()) random_menu_item = choice(menu_items) random_menu_item = choice(menu_items.values()) random_menu_item =
How do you increment the value stored in a variable called score by 1?
Given a users dict that maps usernames to email addresses, how would you get the email address for the user djs? email_address = users{"djs"} email_address = users("djs") email_address = users["djs"] email_address = users[0]