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 BINARY it is making get confused
enot [183]
It is a number that is expressed in the binary numerical system
6 0
3 years ago
Write a program in C++ to implement bubblesort using the swap function ?
marishachu [46]

C++ program for implementation of Bubble sort  

#include <bits/stdc++.h>  

using namespace std;  

 void swap(int *x, int *y)  /*Defining Swap function of void return type*/

{  

  int temp = *x;  //Swaping the values  

   *x = *y;  

   *y = temp;  

}  

void bubbleSort(int array[], int n) /*Defining function to implement bubbleSort  */

{  

  int i, j;  

  for (i = 0; i < n-1; i++)      

      for (j = 0; j < n-i-1; j++)  /*The last i components are already in location  */

      if (array[j] > array[j+1])  

          swap(&array[j], &array[j+1]);  //Calling swap function

}  

int main()  //driver function

{  

   int array[] = {3, 16, 7, 2, 56, 67, 8}; //Input array  

   int n = sizeof(array)/sizeof(array[0]);  //Finding size of array

   bubbleSort(array, n); //Function calling  

   cout<<"Sorted array: \n";  

   for (int i = 0; i < n; i++)  //printing the sorted array

       cout << array[i] << " ";  

   cout << endl;  

 return 0;  

}  

<u>Output</u>

Sorted array:  

2 3 7 8 16 56 67

3 0
3 years ago
All of the following are career pathways in the architecture and construction career cluster except
Dennis_Churaev [7]

Below, I believe are the multiple choices attached to this question

A. Power, Structural, and Technical Systems.

B. Construction.

C. Design/ Pre-Construction.

D. Maintenance/ Operations

The answer is A: Power, Structural, and Technical Systems.

The career pathways in the Architecture and Construction deal with all aspects of designing, planning, and maintaining all kinds of structures we live or work in. It is organized into 3 career pathways; Construction, Design/ PreConstruction, and Maintenance/ Operations. This field also covers the servicing of equipment such as plumbing, electrical wiring, escalators, and elevators.

8 0
2 years ago
When building systems, the only two entities that constitute software engineering are people and process.
VLD [36.1K]

Answer: False

Explanation: Software engineering is the designing, analyzing, creating the software application as per the requirement of the user. The programming languages is the base for the designing of the application the software engineering field.

At the time of building system ,there is the requirement of many resources for the development.There is the requirement of the software skills, programming knowledge, resources and tools for the working and designing.Thus, there are different resources, people,skills processes, problem solving skill etc required for the building of the system.

7 0
3 years ago
In Vista and Windows 7, the Appearance and Personalization option allows you to change the
svetoff [14.1K]
Answer= background
Appearance of the laptop is called theme, it is also related to background
5 0
2 years ago
Other questions:
  • Many who enter the field of information security are technical professionals such as __________ who find themselves working on i
    13·1 answer
  • Is it okay to leave your car running while parked?
    15·1 answer
  • What is the term for sending emails that imitate legitimate companies?
    6·2 answers
  • A communications medium that carries a large amount of data at a fast speed is called
    14·1 answer
  • 1. Define lexemes. Give an example of an lexeme in any programming language.<br>​
    10·1 answer
  • What is the primary purpose of endnotes?
    6·2 answers
  • The reason why our computers can get faster without getting bigger is because of...
    14·1 answer
  • Valerie regularly generates sales reports from her organization's data warehouse. She uses these reports to create presentations
    5·1 answer
  • Custodial workers that access the terminal area must have a fingerprint background check done and training unless they are escor
    15·1 answer
  • ________ helps in determining the cause of a security threat in an incident response plan. Question 7 options: A) Restricting sy
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!