MOn Tue, Nov 19, 2013 at 10:35 AM, Jai <jaiprakashsingh...@gmail.com> wrote: > please help what is this i have try lot but unable to remove it
Your code is getting into an infinite loop. One problem is, I suspect: > def find_position(line): > pun = "" > if re.search(r"[.?!]+", line): > pun = re.search(r"[.?!]+", line).group() > pos = line.find(pun) > pos = pos+len(pun)-1 > return pos When your search fails, this function will return 0. Fix that. In general your problem isn't well defined enough for me to make sense of your algorithm. Can you show sample input and output? Can you describe the algorithm in plain English? -- Neil Cerutti
-- https://mail.python.org/mailman/listinfo/python-list