title: PyCharm error: List index out of range
body: <p>I got list index out of range error in <code>with open(sys.argv[1],'r') as input:</code><br>
  I found one answer in StackOverflow, "just make sure to pass a command line argument when you run the script". But still not working. Can anyone help me with it?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>from collections import Counter
  import sys
  
  newList = []
  
  with open(sys.argv[1],'r') as input:
      for element in input:
          temp = str(element).rstrip("\n")
          temphex = (int(temp,16))
          newList.append(temphex)
  
  veryNew=sorted(newList)
  
  for n in range(len(veryNew)):
      veryNew[n] = hex(veryNew[n])[2:]
      sortedHex = veryNew
  
  d={}
  for item in veryNew:
      if item in d:
          d[item] = d.get(item)+1
      else:
          d[item]=1
  
  
  for k,v in d.items():
      if v &gt; 1:
          print(str(k)+' '+str(v))
  </code></pre>