結果 : pattern detection in python