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
Which of the following job duties would a software developer perform?
juin [17]

<u>The most important job duty of a software developer is to develop a product/program that is easy to use and melts a customer’s need.</u>

<u></u>

Explanation:

Some other duties of  a Software developer are

  • Researching,designing and implementing new software program's and then managing them
  • Testing and evaluating the developed software program's
  • Identifying errors in the existing program's and modifying the same
  • Writing effective codes
  • employing various software tools
  • Training new users
  • Working closely with the other developers

8 0
3 years ago
Critics are concerned about how easy it is to upload and download music on the Internet because:
evablogger [386]
C. people have to buy entire albums, which can get expensive.
6 0
3 years ago
Read 2 more answers
What are Loop Errors? Describe briefly. What aresymptoms of Loop Errors?
victus00 [196]

Answer:

The errors in the loop condition such that it is not giving desired results or it is not running accordingly.There are different types of loop errors which are as following:-

1.Infinite loop:-When the is not able to stop then the error is called infinite loop. for ex:-

int i=1;

while(i!=0)

{

cout<<"I am King"<<endl;

i++;

}

2.Off by one error:-This error mostly happens in loop for arrays as indexing of the array is from 0 to size-1 .So looping over the array up to the size is a off by one error.

3.Equality v/s assignment operator error:-In this error the condition in the loop is like this d=f which is wrong since = is assignment operator it assigns the value of f to d while d==f checks that the value of d and f are equal or not.

4.&& v/s || loop error:- In this error we use and operator (&&) instead of or operator (||) and vice versa.

symptoms of loop errors are not the desired output.

4 0
3 years ago
Computer science
Ksju [112]
Pseudocode is a notation resembling a simplified programming language, used in program design


a text file is a computer file that only contains text and has no special formatting such as bold text, italic text, images, etc.
7 0
3 years ago
A company is recruiting for a web designer. What kind of candidate should the company recruit so that they can complete the task
AveGali [126]

Answer:

Explanation:

The company should recruit someone who possesses at least an associate's degree in computer science or a technical subject and knows designing languages such as HTML5 and CSS. These two languages are the primary design languages that every single web designer must know. Without these two languages, a website cannot be created. Every career in tech teaches these two languages since they are basics that must be known, therefore an associate's degree would show that they have well versed in many technical subjects.

8 0
2 years ago
Other questions:
  • What part of the computer gives access to the internet
    10·1 answer
  • write the algorithm, flowchart and BASIC program to calculate the area of the rectangle length 50m and width 30m.​
    8·1 answer
  • Technology has proliferated in Kenya and Somaliland, with text messages used to replace cash, creating mobile money use that, on
    11·1 answer
  • The only way to print a photo is on a special glossy paper using professional printing services in a store
    9·2 answers
  • Which of the following statements opens the file info.txt for both input and output? a) dataFile.open("info.txt", ios::in &amp;&
    11·2 answers
  • Write a program that prompts the user to enter a point (x, y) and checks whether the point is within the rectangle centered at (
    12·1 answer
  • Project manager George is defining project management to his team. How should he define project management in one sentence?
    7·1 answer
  • Which of the following is constantly changing and advancing?
    11·1 answer
  • What is the most important job of a web server?
    11·2 answers
  • A project manager has designed a new secure data center and has decided to use multifactor locks on each door to prevent unautho
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!