Take the 2-minute tour ×  So here i have a list of numbers of
'Q9ULI0' id. Which is look like this:  ['1117', '285', '357',
'58', '813', '1398', '566']   when i call print lookup['Q9ULI0']
I am trying access all of those value in the index to see if the
number is between two of my value. I tried using .len and for
loop but it doesn't even compile. Thank you in advance.  lookup
= defaultdict(list)  mydata = open('mydata.txt')  for line in
csv.reader(mydata, delimiter='\t'):      code =
re.match('[a-z](\d+)[a-z]', line[-1], re.I)     if code:   print
lookup['Q9ULI0'] share|improve this question "but it doesn't
even compile" -- I assume you mean that there is a syntax error.
Can you post the traceback? –  mgilson Jul 12 '12 at 22:48
@mgilson i was testing to see whether i use lookup.len() or
code.len() would give me the length of the list but it gives me
this error : AttributeError: 'NoneType' object has no attribute
'len' –  Chad D Jul 12 '12 at 22:50 @ChadD I think you want
len(lookup) or len(code) –  Samy Vil