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
Tech A states that modern vehicles use asbestos as the brake material. Tech B states that asbestos is no longer used in brakes.
Tanya [424]

Answer:

Tech A is correct.

Explanation:

The modern day vehicles have brakes system equipped with asbestos. It is a mineral which is a kind of fibrous crystal which enables the friction to stop the vehicle. The technician A specifies that the modern day automobiles use asbestos for their brake system.

4 0
3 years ago
Bit stream methods commonly use algorithm functions like the exclusive or operation (__________.
Dmitry [639]
The answer that fits the blank is XOR or Exclusive OR. Exclusive OR is a logical operation wherein it demonstrates the logic presented by "either/or". This means that if the output given is true, either of the inputs, but never both, should also be true.
5 0
3 years ago
Marissa bought 2 and 1/2 gallons of orange juice to make punch how many quarts of orange juice did Marissa Buy
Vladimir [108]
1 gallon = 4 quarts
using this information, you can then use simple proportion.
if 1 gallon = 4 quarts 
then to find the amount of quarts in 2 and 1/2 gallons, you multiply 2 and 1/2 by 4 which should give you 10 gallons
5 0
3 years ago
Read 2 more answers
SOMEONE PLEASE HELP ME PLEASE HELP ME WITH THIS!!!!!
zavuch27 [327]

Answer:

The last one

Explanation:

I hope this is correct and have a great day

7 0
3 years ago
Read 2 more answers
When is it appropriate to utilize the nat network connection type?
lbvjy [14]
Whenever the VM does not need to be access at a known address by other network nodes.
6 0
3 years ago
Other questions:
  • Which of the following is not a general strategy for organizing and analyzing qualitative data?a.Convert the data into one or mo
    6·1 answer
  • If you think the user might enter 24.9, you should create a float variable. true or false
    9·1 answer
  • file Assume that a prototype of the part above was built from several cubes. The total volume of the part is 0.54675 in.3. What
    6·1 answer
  • A supplier certification program: Group of answer choices
    9·1 answer
  • After a suspected identity fraud case has been resolved, you should:
    10·2 answers
  • Given a variable temps that refers to a list, all of whose elements refer to values of type float, representing temperature data
    10·2 answers
  • The Business Information Building Block feature is available in the _____ grouping on the Insert tab.
    13·1 answer
  • We can sort a given set of n numbers by first building a binary search tree containing these numbers (using Tree-Insert repeated
    12·1 answer
  • Write a pseudocode statement that declares the variable total so it can hold integers. Initialize the variable with the value 0
    9·1 answer
  • Tools used to type text on Ms paint​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!