Python sys.argv lists and indexes
<p>In the below code I understand that sys.argv uses lists, however I am not clear on how the index's are used here.</p>

<pre><code>def main():

  if len(sys.argv) &gt;= 2:
    name = sys.argv[1]
  else:
    name = 'World'
  print 'Hello', name

if __name__ == '__main__':
  main()
</code></pre>

<p>If I change </p>

<pre><code>name = sys.argv[1]
</code></pre>

<p>to</p>

<pre><code>name = sys.argv[0] 
</code></pre>

<p>and type something for an argument it returns:</p>

<pre><code>Hello C:\Documents and Settings\fred\My Documents\Downloads\google-python-exercises
\google-python-exercises\hello.py
</code></pre>

<p>Which kind of make sense.</p>

<p>Can someone explain how the 2 is used here: </p>

<pre><code>if len(sys.argv) &gt;= 2:
</code></pre>

<p>And how the 1 is used here: </p>

<pre><code>name = sys.argv[1] 
</code></pre>
