input: Write a function to generate a Python program that reads the contents from a given URL. The function should return the text content of the page if the request is successful (status code 200), otherwise it should 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://invalidURL.com") is None
  assert read_url("https://www.google.com") is not None
  assert read_url("https://nonexistentdomain.com") is None
output: def read_url(url):
    r = requests.get(url)
    if r.status_code == 200:
      return r.text
    else:
      return None