title: How does importing a module inside a function make code more modular?
body: <p>From <a href="http://www.diveintopython.net/html_processing/all_together.html" rel="nofollow">Dive into Python</a>:</p>
  
  <blockquote>
    <p>You're used to seeing import statements at the top of a program, which
    means that the imported module is available anywhere in the program.
    But you can also import modules within a function, which means that
    the imported module is only available within the function. If you have
    a module that is only ever used in one function, this is an easy way
    to make your code more modular.</p>
  </blockquote>
  
  <p>The other alternative to importing module at the function level is to import it at the module level (of which the function is a part).</p>
  
  <p>Since the module is the reusable unit, how does the former option increase modularity?</p>