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
Please identify three examples of how the United States is heteronormative
juin [17]

Answer:

Well, let's say you're out at a bar. A friend of yours sees a cute guy, but she's hesitant to make the first move because she assumes the guy would be turned off by that - because we're socialized to believe that women shouldn't approach men like that, lest they come off as desperate. That's heteronormativity.

When she finally gets the courage to go up and talk to him, he begins to call her infantilizing pet names (like honey, baby, and sweetheart) - which would be fine if they'd agreed upon it, but he's just assuming she's cool with it! That's heteronormativity.

When she begins to get uncomfortable by these names, she gets up and leaves. But the guy says something like, "Oh, come on! Women are so sensitive. What's your problem?" That's heteronormativity.

5 0
3 years ago
Write a program that include a method that returns the sum of all the elements of a Linked List of Integers. Allow the user to e
Illusion [34]

Answer:

static void Main(string[] args)

       {

           //declare a blank linked list

           LinkedList<int> numList = new LinkedList<int>();

           Console.WriteLine("Enter the Numbers");

           //check if the size of the linkedlist is 10

           while(numList.Count < 10)

           {

               //read the input supplied by the user

               string val = Console.ReadLine();

               //check if the input is integer

               if(int.TryParse(val, out _) == false)

               {

                   //if not integer, display error message and prompt for new number

                   Console.WriteLine("Invalid number");

                   continue;

               }

               //add the inputted number to the linkedlist

               numList.AddLast(int.Parse(val));

               

           }

           //call the method for linkedlist sum and display it

           Console.WriteLine(SumLinkedList(numList));

           Console.Read();

       }

       //method for linkedlist summation

       private static int SumLinkedList(LinkedList<int> val)

       {

           //declare sum as zero

           int sum = 0;

           //loop through the linkedlist to display the num and sum all numbers

           foreach(int item in val)

           {

               Console.Write(item + " ");

               sum += item;

           }

           return sum;

       }

   }

Explanation:

program written with c#

8 0
3 years ago
What methods could you use to set up printing in an organization?
shutvik [7]

The used to set up printing in an organisation are as follows;

  • Connecting directly to the printer
  • setting up a print server
  • using a cloud service to set up printers.

<h3>Method for printing in organisation.</h3>

There are different method for setting up printing in an organisation.

They include the following;

  • Connecting directly to the printer : directly connecting a printer; From small to large organizations, you have lots of ways to set up a printer.
  • setting up a print server
  • using a cloud service to set up printers. There are numerous cloud service that could render this service like goggle.

learn more on printing here: brainly.com/question/14668983

#SPJ11

3 0
2 years ago
A certain list, L, contains a total of n numbers, not necessarily distinct, that are arranged in increasing order. If L1 is the
Free_Kalibri [48]

In this question, we are given ,

  • A certain list, L, contains a total of n numbers, not necessarily distinct, that are arranged in increasing order.
  • L1 is the list consisting of the first n1 numbers in L.
  • L2 is the list consisting of the last n2 numbers in L.

Explanation:

As per the information given in statement 1, 17 is a mode for L1 and 17 is a mode for L2.

Therefore, we can infer that ,

  • 17 must occur in L1, either same or a greater number of times as any other number in L1.
  • 17 must occur in L1, either same or a greater number of times as any other number in L2.

As all elements in L are in ascending order, we can also conclude that

  • Each number between last occurrence of 17 in L1 and the first occurrence of 17 in L2 must be equal to 17 only.
  • Therefore, 17 occurs either same or greater number of times as any other number in L.
  • Thus, 17 is a mode for L.

However, from this statement, we cannot conclude anything about the mode of L1, L2, or L.

Hence, statement 2 is not sufficient to answer the question.

Therefore, 17 is a mode for L1 and 17 is a mode for L2.

3 0
3 years ago
Technician A says aluminum cylinder head surfaces should be scraped clean only with nonmetallic tools to avoid gouging. Technici
fredd [130]
<span><span><span /></span></span>Both Technicians (A and B) are correct since the aluminum cylinder head surfaces should be scraped clean only with nonmetallic tools to avoid gouging and it should also be chemically cleaned in accordance with the manufacturer's recommendations before the inspection.<span><span /></span>
6 0
3 years ago
Read 2 more answers
Other questions:
  • Proxy servers and ACLs on network devices are examples of non-security devices with security features, while firewalls and IDS/I
    8·1 answer
  • Assume you're using a three button mouse. to access shortcut menus, you would
    9·2 answers
  • Use the variables k and total to write a while loop that computes the sum of the squares of the first 50 counting numbers, and a
    10·1 answer
  • Sonora wants to extend the cells to be added in her formula. what is the quickest way to add more sells?
    10·2 answers
  • What is the theory of trouble shooting
    10·2 answers
  • An organization is concerned with the amount of sensor data that is being generated locally, analyzed in the cloud, and returned
    6·1 answer
  • Write a method named removeDuplicates that accepts a string parameter and returns a new string with all consecutive occurrences
    7·1 answer
  • 1. What are you going to do if someone ask for your personal information online?​
    12·2 answers
  • Write a Python program (rainfall.py) to collect data and calculate the average rainfall over a period of years. The program shou
    11·1 answer
  • Choose the response that best completes the following statement.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!