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
Write a function DrivingCost() with input parameters drivenMiles, milesPerGallon, and dollarsPerGallon, that returns the dollar
posledela

Answer:

#include <iostream>

using namespace std;

double DrivingCost(int drivenMiles,double milesPerGallon,double dollarsPerGallon)

{

   double dollarsperMile=dollarsPerGallon/milesPerGallon;//calculating dollarsperMile.

   return dollarsperMile*drivenMiles;//returning thr driving cost..

}

int main() {

double ans;

int miles;

cout<<"Enter miles"<<endl;

cin>>miles;

ans=DrivingCost(miles,20.0,3.1599);

cout<<ans<<endl;

return 0;

}

Output:-

Enter miles

10

1.57995

Enter miles

50

7.89975

Enter miles

100

15.7995

Explanation:

In the function first I have calculated the dollars per mile and after that I have returned the product of dollarspermile and driven miles.This will give the cost of the Driving.

4 0
3 years ago
Rather than entering an IP address into our browser, we use a text-based address known as a(n
zalisa [80]

Answer:

url

Explanation:

7 0
2 years ago
Su now wants to highlight several inventors in her presentation, so she decides to use the underline color option.
Mars2501 [29]

Answer:

1. The home tab

2. Font group

3. The small arrow at the bottom right of the font command group.

4. On "Font" heading (then "All text" subheading)

Explanation:

The following explanation will help Su in accomplishing her task.

1. Go to the home tab;

2. From the home tab, Su will have access to various command groups but in her case, she needs the Font command group.

3. There's a small arrow located at the bottom left of the font command group section; clicking on this arrow will open the font dialogue.

4. On the font dialogue, there are two headings. The "font" heading and the "character spacing" heading.

In her case, she needs the "Font" heading. The font heading also has various subheadings. To access the underline colour option, she needs the "All text" subheading.

See attachment for picture guide.

7 0
3 years ago
Josephine is in the process of creating ads within her Standard Display campaign. She finds that there are two main ad formats t
Tresset [83]

Answer:

B. Responsive display ads

E. Uploaded ad (Image & AMPHTML).

Explanation:

If what you want to achieve is greater control and greater efficiency and scale while you place your ad? Then the two ad format to achieve that are, responsive display ad and uploaded ad.

The uploaded ad will guarantee you have greater control while the responsive display ad gives you greater scale and efficiency.

6 0
3 years ago
Which type of firewall policy calls for a firewall to deny all traffic by default?
charle [14.2K]
Restrictive policy is a kind of policy calls for a firewall to contradict all traffic by default. The first rule denies all traffic on any service and using any port. To permit a specific type of traffic, a new rule must be placed ahead of the deny all rule. A firewall should enforce the overall policy recognized by the network administrator. Enforcement is controlled mainly over setting up packet filtering rules which is a rule base comprises a set of these rules. 
3 0
3 years ago
Other questions:
  • Americans overwhelmingly support organ and tissue donation.
    5·1 answer
  • Need Help !!! Please
    8·1 answer
  • The Transmission Control Protocol (TCP) splits each message into multiple packets. It's possible for packets from the same messa
    10·1 answer
  • Recursion is a natural use for a _____ (stack or queue)
    13·1 answer
  • How to open a new word proccessing document
    9·1 answer
  • Your company has purchased another company that also uses Windows Server 2016 and Active Directory. Both companies need to be ab
    11·1 answer
  • Running the Disk Cleanup utility is a quick way to ________. Group of answer choices defrag your hard drive remove spyware progr
    10·1 answer
  • Which of the following is input devices? (a)Scanner (b) Keyboard (c) Both a and b (d) Plotter​
    5·1 answer
  • HELP!!!
    15·2 answers
  • Alayna is researching information online to write her essay about the Berlin Wall.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!