input: Write a function to scrape photos and captions from a given website using the BeautifulSoup library. The function should accept a URL as input and print the source and caption of each photo found on the webpage.
  def scrape_photos(url):
      from bs4 import BeautifulSoup
      import requests
  
      # Fetch the HTML content from the given URL
      req = requests.get(url)
      html = req.text
  
      # Parse the HTML content using BeautifulSoup
      soup = BeautifulSoup(html, 'lxml')
      image_divs = soup.find_all('div', {'class': 'image-gallery__image'})
  
      # Result list to store the photos and captions
      results = []
  
      # Iterate through the image divs and extract the photo and caption
      for image_div in image_divs:
          figure = image_div.find('figure')
          if figure:
              src = figure.find('img')['src']
              caption = figure.find('figcaption')
              result = {'Photo': src}
              if caption:
                  result['Caption'] = caption.text
              else:
                  result['Caption'] = 'No caption'
              results.append(result)
      
      return results
  
  # Assertion tests
  assert scrape_photos('https://example.com/webpage') == [{'Photo': 'example.jpg', 'Caption': 'Sample caption'}, {'Photo': 'another.jpg', 'Caption': 'No caption'}]
  assert scrape_photos('https://example.com/another_page') == []
  assert scrape_photos('https://example.com/empty_page') == []
output: def scrape_photos(url):
      from bs4 import BeautifulSoup
      import requests
  
      req = requests.get(url)
      html = req.text
      soup = BeautifulSoup(html, 'lxml')
      image_divs = soup.find_all('div', {'class': 'image-gallery__image'})
      results = []
  
      for image_div in image_divs:
          figure = image_div.find('figure')
          if figure:
              src = figure.find('img')['src']
              caption = figure.find('figcaption')
              result = {'Photo': src}
              if caption:
                  result['Caption'] = caption.text
              else:
                  result['Caption'] = 'No caption'
              results.append(result)
      
      return results