Question: Using PYTHON: You invited your friends to your house for a barbeque. Being the good friends that they are, they offered to bring food. Using
Using PYTHON: You invited your friends to your house for a barbeque. Being the good friends that they are, they offered to bring food. Using the starter code below, build a dictionary to show who will bring what food to the gathering. Loop through the list of friends. For each friend, use the random.choice Links to an external site. method to select a food at random from the food list. Once a food is selected, it should be removed from the food list. Add each friendfood pair as a keyvalue pair to the dictionary. The video in the previous question shows how to make the random assignment
import random
friends Sam "Joe", "Pat", "Tom"
food chips "rolls", "salad", "dessert"
whobringswhat
# Fill in missing code
printwhobringswhat
This exercise will be manually graded, point apiece for:
loop through list of friends
food randomly selected
food choice removed from list
friendfood pair added to dictionary
comments
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
