title: I am using a recursive function and need to print from within the function just once
body: <p>I am using python 3 and need to print the final result from within the function(this is not optional). Instead it is printing every time it goes through the function. </p>
  
  <pre><code>def reverseDisplay(number):
  #base case 
  #if number is only one digit, return number
  
    if number&lt;10:
          return number 
    else:
          result = int(str(number%10) + str(reverseDisplay(number//10)))
  
  
    print(result)
    return(result)
  
  def main():
       number = int(input("Enter a number: "))
       reverseDisplay(number)
  
  main()
  </code></pre>
  
  <p>If you enter <code>12345</code> it prints out</p>
  
  <pre><code>21
  
  321
  
  4321
  
  54321
  </code></pre>
  
  <p>I want it to print out <code>54321</code></p>