Home / Expert Answers / Computer Science / code-in-python-please-nbsp-you-are-trying-to-decide-on-a-restaurant-to-go-pa330

(Solved): Code in python, please!   You are trying to decide on a restaurant to go ...



Code in python,You are trying to decide on a restaurant to go to for dinner and need recommendations. Write a function recommend_restaurant(??????? please!

 

You are trying to decide on a restaurant to go to for dinner and need recommendations. Write a function recommend_restaurant(restaurants, min_rating) where restaurants is a list of restaurants containing [restaurant_name, rating] pairs and min_rating is the minimum rating you are willing to accept. The function will return a sorted list of strings containing restaurant names that have a rating greater than or equal to min_rating. You can assume that: - Restaurant names will all be lower case and unique. recommend_restaurant([ ["shawarma king", 4.4], ["cedars", 4.2], ["chipotle", 3.6], ["nuodle express", 2.9] ], 3.6) should return a list containing these restaurants: ["cedars", "chipotle", "shawarma king"] in this order, because these are the only three restaurants with a rating greater or equal to \( 3.6 \) and they are sorted by restaurant name. recommend_restaurant \( ([], 5) \) should return [ ] because there are no restaurants with rating greater or equal to 5 . recommend_restaurant([ ["cedars", 4.2], ["shawarma king", 4.4], ["chipotle", 3.6], ["nuodle express", 2.9] ], 5) should return [] because there are no restaurants with a rating greater or equal to 5 .


We have an Answer from Expert

View Expert Answer

Expert Answer


In this problem, we will learn to work on the lists and to define the function in the Python.
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe