title: how to use string as list's indices in Python
body: <pre><code>     for line in f.readlines():
       (addr, vlanid, videoid, reqs, area) = line.split()
  
       if vlanid not in dict:
            dict[vlanid] = []
  
       video_dict = dict[vlanid]
  
       if videoid not in video_dict:
           video_dict[videoid] = []
  
       video_dict[videoid].append((addr, vlanid, videoid, reqs, area))
  </code></pre>
  
  <p>Here is my code, I want to use videoid as indices to creat a list. the real data of videoid are different strings like this : <code>FYFSYJDHSJ</code></p>
  
  <p>I got this error message:</p>
  
  <pre><code>video_dict[videoid] = []
  TypeError: list indices must be integers, not str
  </code></pre>
  
  <p>But now how to add identifier like 1,2,3,4 for different strings in this case?</p>