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
Leonardo is having difficulty accessing the course website. he should contact the for assistance. (points:1)
Alona [7]
He should contact the teacher for assistance
3 0
3 years ago
Where do you place the logical test argument in an JF function formula?
balandron [24]

Answer:

the first argument listed after IF

Explanation:

The Logical... argument in an IF function formula is always the first argument listed after IF.  And the second option is the value to be printed if the logical...argument is true, and if it is false then the value mentioned as third argument is assigned, or printed. And the logical...argument never comes before the IF function formula. Hence, the right option is the first argument.

7 0
3 years ago
Read 2 more answers
Wrtie down some containerization technology.
Rina8888 [55]

Answer:

Some containerization technologies are listed as follows: Docker, Docker Enterprise, Amazon Elastic Container Service, Container Linux, Amazon's AWS, Microsoft's Azure Container, etc.

Explanation:

Containerization technology is a computer technology that packages software codes and their dependencies in isolated user spaces called containers so that the software can run uniformly and consistently on any infrastructure, using a shared operating system.  It is the modern alternative and companion to virtualization.  In simple terms, containerization is the process which packages an application with the required libraries, frameworks, and configuration files so that it can efficiently run in various computing environments.

5 0
3 years ago
Load the titanic sample dataset from the Seaborn library into Python using a Pandas dataframe, and visualize the dataset. Create
UNO [17]

Answer:

Following is given the data as required.

The images for histograms for age and gender are also attached below.

I hope it will help you!

Explanation:

8 0
3 years ago
Effective character encoding requires:
Dvinal [7]

To answer your question the answer would be B compatible browsers

8 0
3 years ago
Other questions:
  • Cleo finds herself frequently searching for messages from particular senders or with specific subjects. What should she create
    5·1 answer
  • A network technician has configured a point-to-point interface on a router. Once the fiber optic cables have been run, though, t
    12·1 answer
  • A(n) ________ address is a temporary ip address assigned from an available pool of ip addresses.
    12·1 answer
  • Ken is moving to a new city and considering whether he should rent or buy an apartment. what factors should he consider in his d
    5·1 answer
  • What is an example of how pseudo - randomness is used to creative variation​
    5·1 answer
  • Which of the selections below is not a benefit of imaging the computers on your network? There are fewer licensing fees because
    11·1 answer
  • Linda is viewing the campaign report in her Google Ads account after successfully implementing conversion tracking tags for her
    7·1 answer
  • Python
    6·1 answer
  • Assume there are two variables, k and m, each already associated with a positive integer value and further assume that k's value
    13·1 answer
  • What are the peripherals of a computer ​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!