Question: Extracting the ranking Create a new function that will return a variable named rankings, which is a list of dictionaries set up as follows: rankings
Extracting the ranking
Create a new function that will return a variable named rankings, which is a list of dictionaries set up as follows:
rankingsi is a dictionary corresponding to the restaurant whose rank is i For example, from the screenshot above, rankings should be a dictionary with information about Gus's World Famous Fried Chicken.
Each dictionary, rankingsi should have these keys:
rankingsiname: The name of the restaurant, a string.
rankingsistars: The star rating, as a string, eg
rankingsinumrevs: The number of reviews, as an integer.
rankingsiprice: 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.
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
