Restarting a function in Python 3.4
<p>I need help for my python assignment. We have to make a quiz program and I am having trouble with restarting a function.</p>

<p>I need something like continue, but instead runs the function again. Also, some tips on returning values from functions cant hurt! Thanks! ~Also, I just started using python 2 weeks ago, so this is pretty advanced to me. EDIT: Thanks to user: 2ps! :D</p>

<pre><code>#Quiz YAY!
#
#Name Removed
#
#Version 1.0
#
score = 0;
modPassword = "200605015"
def modMode(score):
   print("Entering Overide Mode");
   print("Opening Overide Console")
   cmd = input("Enter Command call exit{} to exit:  ")
   if cmd == "corr":
      print("Adding one point")
      score=score+1
      return(score);
   elif cmd== "manScoreChng":
      score=int(input("What do want the score to be?"));
   elif cmd == 'stop{}':
      raise Exception('Quit by User')

score = modMode(score);
print(score);
</code></pre>

<p>To capture the return of the <code>modMode</code> function, <strong>just make sure you return something at the end</strong>:</p>

<pre><code>score = 0;
modPassword = "200605015"
def modMode(score):
   print("Entering Overide Mode")
   print("Opening Overide Console")
   cmd = input("Enter Command:  ")
   if cmd == "corr":
      print("Adding one point")
      score = score+1
   elif cmd == "manScoreChng":
      score = int(input("What do want the score to be?"))
   elif cmd == 'exit':
      raise Exception('Bye!')
   return int(score) # MAKE SURE YOU HAVE THIS LINE HERE
</code></pre>

<hr>

<p>To call the <code>modScore</code> command over and over again, use a loop.</p>

<pre><code>try:
  while True:
    score = modMode(score) # grab the returned value from modMode by using `=`
    print(score)
except Exception:
  pass
</code></pre>

<p>This will run until the user types in exit.</p>

python function return python-3.4