title: Make a function behave differently between first and subsequent calls
body: <pre><code>def download():
      upgrade = True
      if upgrade:
          # do a download using tftp
      else:
          # do a download via HTTP
  </code></pre>
  
  <p>As you can see, I have a hard coded value of upgrade that is set to true. In this script, it always does a tftp download. </p>
  
  <p>How do I change the script to do tftp download at the first iteration and in the next iteration when the function download is called, it does a http download?</p>