input: Write a function in Python to scrape photos and their captions from a given website. The function should return a list of tuples, where each tuple contains the URL of the photo and its caption. If the caption is not present, it should be represented as an empty string.
  
  
  from bs4 import BeautifulSoup
  import requests
  
  def scrape_photos_and_captions(url):
      req = requests.get(url)
      html = req.text
      soup = BeautifulSoup(html, features='lxml')
      image_divs = soup.find_all('div', {'class': 'image-gallery__image'})
      result = []
      
      for image_div in image_divs:
          figure = image_div.find('figure')
          src = figure.find('img')['src']
          caption_tag = figure.find('figcaption')
          caption = caption_tag.text if caption_tag else ''
          result.append((src, caption))
      
      return result
  
  # Test cases
  assert scrape_photos_and_captions('https://example.com/webpage') == [('image_url1', 'Caption 1'), ('image_url2', ''), ('image_url3', 'Caption 3')]
  assert scrape_photos_and_captions('https://example.com/another_page') == [('image_url4', 'Caption 4'), ('image_url5', 'Caption 5')]
  assert scrape_photos_and_captions('https://example.com/empty_page') == []
  
output: 
  def scrape_photos_and_captions(url):
      req = requests.get(url)
      html = req.text
      soup = BeautifulSoup(html, features='lxml')
      image_divs = soup.find_all('div', {'class': 'image-gallery__image'})
      result = []
      
      for image_div in image_divs:
          figure = image_div.find('figure')
          src = figure.find('img')['src']
          caption_tag = figure.find('figcaption')
          caption = caption_tag.text if caption_tag else ''
          result.append((src, caption))
      
      return result
  