title: Python argparse: Does it have to return a list?
body: <p>I am trying to obtain a string of numbers from argparse. It's optional whether or not the argument -n is provided. </p>
  
  <pre><code>import argparse
  parser = argparse.ArgumentParser()
  parser.add_argument('-n', nargs=1) # -n is optional but must come with one and only one argument
  args = parser.parse_args()
  test = args.n
  if test != 'None':
      print("hi " + test) 
  </code></pre>
  
  <p>The program fails when I do not provide "-n argument", but works fine when I do. </p>
  
  <pre><code>Traceback (most recent call last):
    File "parse_args_test.py", line 7, in &lt;module&gt;
      print("hi " + test) 
  TypeError: Can't convert 'NoneType' object to str implicitly
  </code></pre>
  
  <p>How can I fix this? </p>