I have 2 Lists in my code.
data list is having len = 11
new_list is having len = 23
I have to search if a string from data list exists in new_list.. I can see that my target_data gets filled with data,but when i go to print it i get an error..
here is my code:
data list is having len = 11
new_list is having len = 23
I have to search if a string from data list exists in new_list.. I can see that my target_data gets filled with data,but when i go to print it i get an error..
here is my code:
print len(new_list) print len(data) for i in range(len(new_list)): parts = (new_list[i].split('|')) #print parts if (int(parts[8]) >= 1 or int(parts[9]) >= 1 or int(parts[11]) >= 1 ): variable = parts[1] variable = variable.strip() variable = variable + "']" #print variable for d in data: if variable in d: target_data.append(d) print "ok" else: NODATA = 1 else: NODATA = 1 print target_data
Error:23
11
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
list index out of range
How do i take care of this list out of range error?