input: Write a function to scrape photos and captions from a given website. Provide the URL as input and print the photo URLs and their captions. If a photo has no caption, indicate that as well. If the website is empty or inaccessible, print an appropriate message.
  
  def scrape_photos_and_captions(url):
      try:
          req = requests.get(url)
          html = req.text
          soup = BeautifulSoup(html, features='lxml')
          image_divs = soup.find_all('div', {'class': 'image-gallery__image'})
          
          if not image_divs:
              print("No photos or captions found.")
              return
          
          for image_div in image_divs:
              figure = image_div.find('figure')
              src = figure.find('img')['src']
              caption = figure.find('figcaption')
              print('Photo: ', src)
              if caption:
                  print('Caption: ', caption.text)
              else:
                  print('No caption')
              print('\n')
      except requests.exceptions.RequestException:
          print("Could not access the website.")
  
  assert scrape_photos_and_captions('https://example.com/webpage')==None
  assert scrape_photos_and_captions('https://nonexistentwebsite.com')=="Could not access the website."
  assert scrape_photos_and_captions('https://emptywebsite.com')=="No photos or captions found."
output: def scrape_photos_and_captions(url):
      try:
          req = requests.get(url)
          html = req.text
          soup = BeautifulSoup(html, features='lxml')
          image_divs = soup.find_all('div', {'class': 'image-gallery__image'})
          
          if not image_divs:
              print("No photos or captions found.")
              return
          
          for image_div in image_divs:
              figure = image_div.find('figure')
              src = figure.find('img')['src']
              caption = figure.find('figcaption')
              print('Photo: ', src)
              if caption:
                  print('Caption: ', caption.text)
              else:
                  print('No caption')
              print('\n')
      except requests.exceptions.RequestException:
          print("Could not access the website.")