Possible Duplicate:
efficient word indexing in python
Apologies for the basic question, how can I find the indexes ((1,2),(2,1),(2,2)) corresponding to “yellow” in ref and store them so that I can access them afterwords without rerunning the search?
ref1 = "this is a test"
ref2 = "this is a yellow test"
ref3 = "this is yellow"
ref4 = "yellow and orange are colors"
ref = ((ref1,ref2),(ref3,ref4))
Just for the sake of it:
but you probably want the real index (starting at zero)… Remove the second argument of
enumerateif so.