input: Write a function that reads the contents from a given URL. If the request is successful, return the content; otherwise, return None.
  
  def read_url(url):
    r = requests.get(url)
    if r.status_code == 200:
      return r.text
    else:
      return None
  
  assert read_url("https://example.com") is not None
  assert read_url("https://nonexistentwebsite.com") is None
  assert read_url("https://httpstat.us/500") is None
  assert read_url("") is None
output: def read_url(url):
    try:
      r = requests.get(url)
      if r.status_code == 200:
        return r.text
      else:
        return None
    except requests.exceptions.RequestException:
      return None