Question: Create a new function that will return a variable named rankings, which is a list of dictionaries set up as follows: rankings [ i ]
Create a new function that will return a variable named rankings, which is a list of dictionaries set up as follows:
rankings i is a dictionary corresponding to the restaurant whose rank is For example, from the screenshot above, rankings should be a
dictionary with information about Gus's World Famous Fried Chicken.
Each dictionary, rankings i should have these keys:
rankings iname : The name of the restaurant, a string.
rankingsistars: The star rating, as a string, eg
rankings inumrevs: The number of reviews, as an integer.
rankings iprice : The price range, as dollar signs, eg$$$$$$ or $$$$
Of course, since the current topic is regular expressions, you might try to apply them possibly combined with other string manipulation methods find the
particular patterns that yield the desired information.
In :
### Define demo inputs
demostrex yelphtml
The demo included in the solution cell below should display the following output:
extractrankingdemostrex
name: 'Gus's World Famous Fried Chicken',
'stars':
'numrevs':
'price': $$
name: 'South City Kitchen Midtown',
'stars':
'numrevs':
'price': $$
name: 'Mary Mac's Tea Room',
'stars':
'numrevs':
'price': $$
name: 'Busy Bee Cafe', 'stars': 'numrevs': 'price': $$
name: 'Richards' Southern Fried',
'stars':
'numrevs':
'price': $$
name: 'Greens & Gravy', 'stars': 'numrevs': 'price': $$
name: 'Colonnade Restaurant',
'stars':
'numrevs':
'price': $$
name: 'South City Kitchen Buckhead',
'stars':
'numrevs':
'price': $$
name: 'Poor Calvin's', 'stars': 'numrevs': 'price': $$
name: 'Rock's Chicken & Fries',
'stars':
'numrevs':
'price': $
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
