title: Stop Function Call
body: <p>I am trying to stop my function call after executing "exit" user input. But failed to achieve this.
  Below is my code.</p>
  
  <pre><code>&gt; def ufun():
  &gt;         while True:
  &gt;                 uipt = str(raw_input('Please enter your choice? [y|n]:'))
  &gt;                 if uresp == "y":
  &gt;                         ufun.uipt = "y"
  &gt;                         break
  &gt;                 elif uresp == "n":
  &gt;                         ufun.uipt = "n"
  &gt;                         break
  &gt;                 else:
  &gt;                         print("Please enter either [y|n]") def anofunc():
  &gt; 
  &gt; def anofunc():
  &gt;         ulist = str(raw_input('Enter your choice [ALL|AB|BC|EXIT] : ')).upper()
  &gt;         ufun()
  &gt;         if ulist == "ALL":
  &gt;            #execute something
  &gt;         elif ulist == "AB":
  &gt;            #execute something
  &gt;         elif ulist == "BC":
  &gt;            #execute something
  &gt;         elif ulist == "EXIT":
  &gt;            return
  &gt;         else:
  &gt;            print "Please enter a valid option"
  &gt;            anofunc() 
  anofunc()
  </code></pre>
  
  <p>So when I try exit the code while entering "EXIT" user input it asks me for "Please enter your choice? [y|n]:" which I don't want while exiting. I want my code to be exit right away.
  Please help me if I can do this.</p>
  
  <pre><code>Enter your choice [ALL|AB|BC|EXIT] : exit
  Please enter your choice? [y|n]:
  </code></pre>