input: Write a function to generate a python program that reads the contents from a given URL. If the request is successful, return the text content of the URL, otherwise return None.
  
  ### Function:
  def read_url(url):
    r = requests.get(url)
    if r.status_code == 200:
      return r.text
    else:
      return None
  
  ### Test Cases:
  assert read_url('https://google.com') == '<!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="en">...</html>'
  assert read_url('https://nonexistentwebsite.com') == None
  assert read_url('https://jsonplaceholder.typicode.com/posts/1') == '{\n  "userId": 1,\n  "id": 1,\n  "title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",\n  "body": "quia et suscipit\\nsuscipit recusandae consequuntur expedita et cum\\nreprehenderit molestiae ut ut quas totam\\nnostrum rerum est autem sunt rem eveniet architecto"\n}'
  assert read_url('https://example.com') == '<!doctype html>\n<html>\n<head>\n    <title>Example Domain</title>\n    ...\n</head>\n<body>\n...\n</body>\n</html>'
output: def read_url(url):
    r = requests.get(url)
    if r.status_code == 200:
      return r.text
    else:
      return None