title: How to let a list append "nothing" (NOT NULL VALUE)
body: <p>I have a function that will return different values depending on an if statement in the function. The returned value will be added to an existing list. However, in the function there is a case where I want the function to do nothing, i.e., the existing list will keep the same as if no function were called. Currently what I'm doing is the following, but I feel this looks messy and wondering if there is a better way to do:</p>
  
  <pre><code>import requests
  def myfun(url):
      response=requests.get(url)
      code=response.status_code
      if code==503:
         time.sleep(3*random.random())
         value=None
      else:
         html=response.content()
         value=html['some tag']
      return (value,code)
  
  lists=[]
  for url in [my url pool]:
       (value,code)=myfun(url)
       lists.append(value)
       if code==503:
          lists.pop()
  </code></pre>
  
  <p>So basically what I do is to continuously visit some webpage, read some values then put the values in a growing list. However, sometime I get blocked (where Error Code 503 is given), then I want my code to sleep for a while then keep moving forward. In the case where  I get 503 error code, nothing will be returned so the growing list will be the same. But I don't know how to specify this case when I call the function, so I just set the returned values to None (or could be any value), then add them to the list but remove them from the list right after that. (So I use append() then pop() if the code is 503)</p>