Skip to content

Commit

Permalink
Name, Cuisines, Rating and Address Update main.py
Browse files Browse the repository at this point in the history
Adding in the Rating and Address datapoint to the display:
Tapping into the "starRating"  key in order to display the ratings as a number
Formatting the address to my desired way of display.
  • Loading branch information
Uma2197 authored Apr 21, 2024
1 parent 46c7348 commit f037799
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ def display_restaurant_info(data):
for restaurant in data:
name = restaurant['name']
cuisines = ", ".join([cuisine['name'] for cuisine in restaurant['cuisines']])
rating = restaurant['rating']['starRating']
address = f"{restaurant['address']['firstLine']}, {restaurant['address']['postalCode']}, {restaurant['address']['city']}"

print(f"Name: {name}\nCuisines: {cuisines}")
print(f"Name: {name}\nCuisines: {cuisines}\nRating: {rating}\nAddress: {address}\n")


display_restaurant_info(restaurant_data)

0 comments on commit f037799

Please sign in to comment.