title: How to use 'def' to get an input value
body: <p>If I use global variables. I can write like this way.</p>
  
  <pre><code>while True:
      name_str = input('Please give me the file name:')
      if name_str == 'table.csv':
          break
      else:
          print('Bad file name, please try again.')
  </code></pre>
  
  <p>How to def a function and get input from this function?
  Get users' input in the beginning function and call main function to get users' input.</p>
  
  <pre><code>def get_name(n):
      x = input('Please give me the file name:')
      ...
      ...
  
  def main():
      ...
      ...
  </code></pre>