input: Write a Python function to access the Yelp API and return the average ratings for all restaurants in a given zip code.
  assert round(get_restaurant_ratings('94115'), 1) == 4.0
  assert round(get_restaurant_ratings('10001'), 1) == 3.5
  assert round(get_restaurant_ratings('90210'), 1) == 4.5
output: import requests
  
  def get_restaurant_ratings(zip_code):
      api_key = 'YOUR_YELP_API_KEY'
      headers = {
          'Authorization': f'Bearer {api_key}',
      }
      url = 'https://api.yelp.com/v3/businesses/search'
      params = {
          'location': zip_code,
          'categories': 'restaurants',
          'limit': 50
      }
      response = requests.get(url, headers=headers, params=params)
      data = response.json()
      
      ratings = [business['rating'] for business in data['businesses']]
      if ratings:
          return sum(ratings) / len(ratings)
      else:
          return 0.0