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
Unicode is a world standard to represent _________________
horsena [70]

Answer:

characters.

Explanation:

We need to represent characters in binary format so that they can be stored in computer memory. Earlier, ASCII (American Standard Code for Information Interchange) representation was commonly used for english characters. But ASCII was found to be insufficient for representing multilingual and special characters.Unicode character representation was developed to overcome this limitation.

8 0
3 years ago
Different types of names given to explicit convertion in java<br>​
melamori03 [73]

Answer:

Different types of name given to explicit conversation in java are

1. Automatic

2. Explicit

3 0
3 years ago
If Number = 7, what will be displayed after code corresponding to the following pseudocode is run? (In the answer options, new l
kherson [118]

Answer:

5,10; 6,12; 7,14

Explanation:

We will demonstrate the iteration of the loop:

First iteration: Number = 7, Count = 5 at the beginning. We will check if Count <= Number? Since it is correct, prints 5,10. Increment the Count by 1.

Second iteration: Number = 7, Count = 6. We will check if Count <= Number? Since it is correct, prints 6,12. Increment the Count by 1.

Third iteration: Number = 7, Count = 7. We will check if Count <= Number? Since it is correct, prints 7,14. Increment the Count by 1.

Forth iteration: Number = 7, Count = 8. We will check if Count <= Number? Since it is not correct, the loop stops.

8 0
3 years ago
Computer virus is a<br> a. software<br> b. hardware<br> c. bacteria<br> d. none of these
Nimfa-mama [501]
The answer is software
8 0
4 years ago
The was the series of events that marked the start of the Information Age
Artyom0805 [142]

The Information Age was the series of events that marked the start of the Information Age

Further Explanation:

I would simply put digital revolution as the gradual shift of technology from analogue to what is now known as digital technology. This sort of a paradigm shift began somewhere between the late 1950s to the late 1970s and has continued to this day. In a span of only 50 years, digital revolution has advanced tremendously and it is yet to start. The Digital Revolution marked the beginning of the Information Age.

The Information Age or the computer age as many would put it is what defines this shift. The invention of transistors, chips and the internet revolutionized the modern world and brought about the birth of information age. It is what connects us to the human civilization. Scientists capitalized on digital micro-miniaturization and as a result formed the Information Age. It is here with us and its sole existence has been embraced by billions of people worldwide.

Learn more about information age

brainly.com/question/10028333

brainly.com/question/10385855

#LearnWithBrainly

7 0
3 years ago
Other questions:
  • Which diagrams represent how roles can affect careers and lifestyles
    11·1 answer
  • Do yall play games..............................................................................................................
    8·2 answers
  • Although heart rate increases and decrease depending upon activity level on average a typical person heart rate is about _____ b
    10·1 answer
  • Li Chang has recently started his own business. He plans to launch his design for an application (app) for a smartphone. All of
    9·1 answer
  • What is subscriber billing in Google Play and where does the money go?
    5·1 answer
  • You are an IT manager at Gigantic Life Insurance. You have a new desktop support person starting today whose experience is limit
    10·1 answer
  • Given a string, an integer position, and an integer length, all on separate lines, output the substring from that position of th
    10·1 answer
  • A user calls the help desk to report that a mobile device exhibits very slow performance. What could cause this problem
    9·1 answer
  • WILL GIVE BRAINLIST Which statements accurately describe electronic tools? Check all that apply. Electronic tools collect large
    12·1 answer
  • 30 POINTS FOR THE CORRECT ANSWERS
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!