title: How to prevent Function B returning 'none' to Function A that calls it, after function B calls function C and returns to itself
body: <p>Apologies for the confusing title, but here is a very simplified version of what I mean:</p>
  <pre><code>def main():
      burger = 0
      shake = 0
  
      run = True
      while run:
          choice = show_menu()
  
          if choice == &quot;burger&quot;:
              qt_burger += 1
          elif choice == &quot;shake&quot;:
              qt_shake += 1
          else:
              show_bill
  
  def show_menu():
      choice = input(&quot;Burger or Shake?: &quot;)
      if choice not in [&quot;burger&quot;, &quot;shake&quot;]:
          show_error(choice)
      else:
          return choice
  
  def show_error(choice):
      print(f&quot;{choice} is not an option&quot;)
      show_menu()
  
  main()
  </code></pre>
  <p>Function 'main' defines variable 'choice' based on what is returned from function 'show_menu'. If show_menu does not call show_error, the program properly returns the input value back to 'choice' in 'main'. However, if show_error is called, show_menu is called again, and a proper value is entered the second time, choice in main becomes 'none'. Is there any way around this while keeping all these separate functions? I have also tried re-calling show_menu from within itself rather than from within the error function, but it is the same result.</p>