title: How does this function inside a decorator work in Python?
body: <pre><code>def title_decorator(print_name_function):
  #in addition to printing name it will print a title
      def wrapper():
          #it will wrap print_my_name with some functionality
          print("Professor:")
          print_name_function() #&lt;----- QUESTION HERE
          #wrapper will print out professor and then call print_name_function
      return wrapper
  
  def print_my_name():
      print("Joseph")
  
  def print_mike():
      print("Mike")
  
  decorated_function = title_decorator(print_mike)
  #calling decorator function, passing in print_my_name
  
  decorated_function
  decorated_function()
  </code></pre>
  
  <p>Under <code>def wrapper()</code> we have <code>print_name_function()</code>, how does this work and why did we include <code>()</code> here?</p>
  
  <p>I see we are passing in <code>print_name_function</code> into <code>title_decorator</code></p>
  
  <p>But I don't really understand how it was included in <code>def wrapper()</code> and what it means to include <code>()</code> behind <code>print_name_function()</code></p>