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 is the easiest way to beat all of the fnaf games without getting killed and beating all of the nights?
MrRa [10]

Answer:

If you want the game to be "hard" be paranoid. If you are not scared, this game is simple. All you have to do is check your camera to pirate's cove to see if foxy is there. Otherwise, check the halls on your left and right. When Bonnie and/or Chica come, quickly close your doors and wait till they go away. Then, on night five, check the stage to make sure freddy has not moved. Night 5+ is the only real challenge.

Explanation:

My Strategy

Rythm is essential to surviving all the nights at Freddy Fazbears. Here is what I do.

First, check the light on the left.

If anyone is there close the door, or keep the door shut

If not, or after you have closed the door, move on to the next step.

Then, close the right door*.

Check the camera to make sure foxy has not moved.

If Foxy has moved, quickly shut the right door and check camera 2A. When your are pulled out of your camera, return to your camera and check on Foxy.

Check the right hall light.

If anyone is there close the door, or keep the door shut.

If no one is there, or you have the door shut, repeat all of these steps

5 0
3 years ago
Read 2 more answers
How many voltage values can be represented with a 10-bit binary code?
viktelen [127]
Answer is D. 1024
8 bits is enough to represent 256 different numbers. 9 bits is enough to represent 512 numbers. 10 bits can represent 1024 numbers.
8 0
3 years ago
It's not possible to die in an alcohol-related collision if you're not in an automobile.
frutty [35]

Answer:

B. False

Explanation:

  • Consumption of alcohol is not a good practice and is generally not allowed at the time of driving an automobile and is considered to be an offense as it may be injurious to health and property.
  • As too much alcohol can create possible chances of collusions and even if the person is not in an automobile can result in a collision if tries to cross the road. Like head injuries or leg injuries can occur.
8 0
3 years ago
The layout gallery displays 10 slide layouts with a variety of placeholders to define text and content positioning and formattin
Papessa [141]
The above statement is FALSE.

The layout gallery displays 9 slide layouts NOT 10. 

These 9 layouts have various<span> placeholders to define text and content positioning and formatting.

</span>1 - Title slide
2 - Title and content
3 - Section Header
4 - Two content
5 - Comparison
6 - Title only
7 - Blank 
8 - Content with Caption
9 - Picture with Caption
8 0
3 years ago
Write the code for invoking a static method named sendTwo, provided by the DataTransmitter class. There are two arguments for th
MAVERICK [17]

Answer:

DataTransmitter.sendTwo(15.955, 13);

Explanation:

The code above will call the method sendTwo() which exists inside the class DataTransmitter

Because this a static method it can be invoked with only the dot operator without making an object of the DatTransmitter class with the new Operator

Since the method sendTwo () accepts two parameters of type double and int respectively, the values 5.955, 13 are passed as argument during the method call.

5 0
3 years ago
Other questions:
  • Positive thinkers tend to
    9·2 answers
  • To illustrate a point in a Word document with a simple chart, what commands should you select?
    8·2 answers
  • 1 Explain the difference between using a computer program and programming a computer.
    12·1 answer
  • Your supervisor has asked you to set up a RAID hard drive array in a tower system, which has a motherboard that uses the B360 ch
    10·1 answer
  • An electronic device that can accept data as input, process it according to a program, store it, and produce information as outp
    6·1 answer
  • Determine the distance between point (x1, y1) and point (x2, y2), and assign the result to points Distance. The calculation is:
    12·1 answer
  • In what kind of attack can attackers make use of hundreds of thousands of computers under their control in an attack against a s
    7·2 answers
  • On what aspect of digital media do people often focus on at the expense of the important supporting roles?
    8·1 answer
  • What are the importance of Help and Support feature of Windows​
    6·1 answer
  • IF YOU WANT NICELY ENGLISH MUSIC ADD MY W.h.a.t.s.A.p.p nomber <br>+60 199094836​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!