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
charle [14.2K]
3 years ago
5

Write a function called no_you_pick. no_you_pick should have two parameters. The first parameter is a dictionary where the keys

are restaurant names and the values are lists of attributes of those restaurants as strings, such as "vegetarian", "vegan", and "gluten-free".
#
#The second parameter is a list of strings representing of necessary attributes of the restaurant you select.
#
#Return a list of restaurants from the dictionary who each contain all the diet restrictions listed in the list, sorted alphabetically. If there are no restaurants that meet all the restrictions, return the string
#"Sorry, no restaurants meet your restrictions". Types of diet restrictions that exist in this question's universe are: vegetarian, vegan, kosher, gluten-free, dairy-free
#
#For example:
#grading_scale = {"blossom": ["vegetarian", "vegan", "kosher", "gluten-free", "dairy-free"], \
# "jacob's pickles": ["vegetarian", "gluten-free"], \
# "sweetgreen": ["vegetarian", "vegan", "gluten-free", "kosher"]}
#guests_diet = ["dairy-free"]
#no_you_pick(grading_scale, guests_diet) -> ["blossom"]


#Write your code here!
def no_you_pick(restaurants, preferred_diet):
result = []
for i in preferred_diet:
for key, value in restaurants.items():
# print(value)
if i in value:
result.append(key)
result.sort()
return result
return "Sorry, no restaurants meet your restrictions"

#Below are some lines of code that will test your function.
#You can change the value of the variable(s) to test your
#function with different inputs.
#
#If your function works correctly, this will originally
#print: blossom
grading_scale = {"blossom": ["vegetarian", "vegan", "kosher", "gluten-free", "dairy-free"], \
"jacob's pickles": ["vegetarian", "gluten-free"], \
"sweetgreen": ["vegetarian", "vegan", "gluten-free", "kosher"]}
guests_diet = ["dairy-free"]
print(no_you_pick(grading_scale, guests_diet))
**My code doesn't seem to work, any help with it I'll really appreciate it!**
Computers and Technology
1 answer:
Pachacha [2.7K]3 years ago
6 0

Answer:

...

Explanation:

You might be interested in
What are four different commands in Internet Explorer and identify their keyboard shortcuts
Zigmanuir [339]
<span>Ctrl + Q -  show all tabs
Ctrl + O - open a file
Ctrl + T - Open a New Tab
Ctrl + W -  close a tab

Hope This Helped <3
</span>
6 0
3 years ago
Which of the following computer component facilitates internet connection?
babunello [35]

Answer:

your answer may be(utility software)

8 0
2 years ago
Read 2 more answers
Which of the following subject lines would be best to use when applying for a position in a high school teacher
mel-nik [20]

Answer:

option d

Explanation:

Subject line should be short but descriptive. Whenever a person reads a subject, he/she should know what the application is all about. In the question, the application is all about applying for a school teacher so subject must contain words for teacher.

7 0
3 years ago
What do you observe on the filter paper strip after 2 to 3 hours?
just olya [345]
Is there pictures or anything esle to read in order to figure out the answer

5 0
3 years ago
Read 2 more answers
True or False: Nested elements must be indented with respect to parent elements in
Dovator [93]

Answer:

true

Explanation:

7 0
3 years ago
Other questions:
  • Which of the following statements is true regarding ARPANET? Select 3 options. It was a product of Bell Laboratories and was int
    9·1 answer
  • Why are computer programs so much longer now than they were in the late 1980?
    8·1 answer
  • WHAT DOES THE WORD MONOCHROME MEAN?
    11·1 answer
  • Two routers connect with a serial link, each using its S0/0/0 interface. The link is currently working using PPP. The network en
    6·1 answer
  • The larger the Word Size of a computer
    6·1 answer
  • Microsoft windows malicious software removal tool fake or real
    8·1 answer
  • Select the correct answer.
    9·2 answers
  • Stephanie would like to know the average number of regular hours worked by her employees. In cell B11, create a formula using th
    8·1 answer
  • Explain ,how the computer network reduces cost of operation? (don't copy from any website)​
    14·1 answer
  • can you still receive messages on messenger from a person when you deleted the conversation with them? (But not blocked them)
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!