String Matching Algorithm In Python Definition