input: Write a function to read the contents of a given URL and return the text if the request is successful, 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://www.example.com")=="<!doctype html>\n<html>\n<head>\n    <title>Example Domain</title>..."
  assert read_url("https://www.nonexistentwebsite.com")==None
output: def read_url(url):
    r = requests.get(url)
    if r.status_code == 200:
      return r.text
    else:
      return None